summaryrefslogtreecommitdiffstats
path: root/tools/start-stop-daemon.c
diff options
context:
space:
mode:
authorpaco <paco@voltanet.io>2018-06-13 16:33:51 +0200
committerpaco <paco@voltanet.io>2018-06-13 16:33:51 +0200
commite1be9119f8dc6d8303d657a2536d4ecaef216f3b (patch)
tree2f0791851993ecd59fa9db06269ec8fc912a88f1 /tools/start-stop-daemon.c
parentMerge pull request #2420 from pacovn/Coverity_1399246_Logically_dead_code (diff)
downloadfrr-e1be9119f8dc6d8303d657a2536d4ecaef216f3b.tar.xz
frr-e1be9119f8dc6d8303d657a2536d4ecaef216f3b.zip
tools: out-of-bounds access (Coverity 1399290)
Signed-off-by: F. Aragon <paco@voltanet.io>
Diffstat (limited to 'tools/start-stop-daemon.c')
-rw-r--r--tools/start-stop-daemon.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/start-stop-daemon.c b/tools/start-stop-daemon.c
index 6bf55b774..5f13b90be 100644
--- a/tools/start-stop-daemon.c
+++ b/tools/start-stop-daemon.c
@@ -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");