]> git.puffer.fish Git - mirror/frr.git/commitdiff
tools: out-of-bounds access (Coverity 1399290) 2431/head
authorpaco <paco@voltanet.io>
Wed, 13 Jun 2018 14:33:51 +0000 (16:33 +0200)
committerpaco <paco@voltanet.io>
Wed, 13 Jun 2018 14:33:51 +0000 (16:33 +0200)
Signed-off-by: F. Aragon <paco@voltanet.io>
tools/start-stop-daemon.c

index 6bf55b77405661decbe488af5c3006f4ac705b1a..5f13b90be339bdbd16645e16f1f41666e5207450 100644 (file)
@@ -258,11 +258,11 @@ static void add_namespace(const char *path)
                nsname = cur;
        }
 
-       if (!memcmp(nsdirname, "ipcns/", strlen("ipcns/")))
+       if (!strncmp(nsdirname, "ipcns/", strlen("ipcns/")))
                nstype = CLONE_NEWIPC;
-       else if (!memcmp(nsdirname, "netns/", strlen("netns/")))
+       else if (!strncmp(nsdirname, "netns/", strlen("netns/")))
                nstype = CLONE_NEWNET;
-       else if (!memcmp(nsdirname, "utcns/", strlen("utcns/")))
+       else if (!strncmp(nsdirname, "utcns/", strlen("utcns/")))
                nstype = CLONE_NEWUTS;
        else
                badusage("invalid namepspace path");