diff options
author | Matt Fleming <matt.fleming@intel.com> | 2012-11-29 09:06:41 +0000 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2012-11-29 09:06:41 +0000 |
commit | 771aea5ed2eb791717eea939089f8246a47d8634 (patch) | |
tree | 744701abea4dfe39075a43f390c7a07dea03a0ef | |
parent | 556e76db9ba0d8f23770b839c9f42121b61d4348 (diff) | |
download | syslinux-771aea5ed2eb791717eea939089f8246a47d8634.tar.gz syslinux-771aea5ed2eb791717eea939089f8246a47d8634.tar.xz syslinux-771aea5ed2eb791717eea939089f8246a47d8634.zip |
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 <matt.fleming@intel.com>
-rw-r--r-- | com32/lib/sys/module/common.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/com32/lib/sys/module/common.c b/com32/lib/sys/module/common.c index dfbdf617..d72dd702 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++; |