From 5593964ead053d980db60ac42acf194040b85452 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Fri, 24 Jan 2014 08:17:53 +0900 Subject: [PATCH] embryo: force the insertion of a '/' in the path to be sure that file path make sense. --- src/bin/embryo/embryo_cc_sc2.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/bin/embryo/embryo_cc_sc2.c b/src/bin/embryo/embryo_cc_sc2.c index 90e177c16a..0b72ee312a 100644 --- a/src/bin/embryo/embryo_cc_sc2.c +++ b/src/bin/embryo/embryo_cc_sc2.c @@ -146,10 +146,8 @@ plungefile(char *name, int try_currentpath, int try_includepaths) { char path[PATH_MAX]; - strncpy(path, ptr, sizeof path); + snprintf(path, sizeof (path), "%s/%s", ptr, name); path[sizeof path - 1] = '\0'; /* force '\0' termination */ - strncat(path, name, sizeof(path) - strlen(path) - 1); - path[sizeof path - 1] = '\0'; result = plungequalifiedfile(path); } /* while */ } /* if */