From 771aea5ed2eb791717eea939089f8246a47d8634 Mon Sep 17 00:00:00 2001 From: Matt Fleming Date: Thu, 29 Nov 2012 09:06:41 +0000 Subject: [PATCH] module: Append '/' to PATH strings if missing We shouldn't be appending a filename to any path string that isn't terminated by a '/', otherwise we end up searching for files like '/isolinuxpwd.c32' Signed-off-by: Matt Fleming --- com32/lib/sys/module/common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/com32/lib/sys/module/common.c b/com32/lib/sys/module/common.c index dfbdf61..d72dd70 100644 --- a/com32/lib/sys/module/common.c +++ b/com32/lib/sys/module/common.c @@ -78,6 +78,10 @@ again: if (*p == ':') p++; + /* Ensure we have a '/' separator */ + if (path[i] != '/' && i < FILENAME_MAX - 1) + path[i++] = '/'; + n = name; while (*n && i < FILENAME_MAX - 1) path[i++] = *n++; -- 2.7.4