aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-05-01 16:00:12 +0100
committerMatt Fleming <matt.fleming@intel.com>2012-05-01 16:00:12 +0100
commit254db41a8b0cf5f92bd6ff3f3e20bbd64ede071e (patch)
treeb371e4bf3cee0232a61f5c06defe8894521d869d
parent34ec5204dc2f2e6130f611b0710d475f7dd9d609 (diff)
downloadsyslinux-254db41a8b0cf5f92bd6ff3f3e20bbd64ede071e.tar.gz
syslinux-254db41a8b0cf5f92bd6ff3f3e20bbd64ede071e.tar.xz
syslinux-254db41a8b0cf5f92bd6ff3f3e20bbd64ede071e.zip
ldlinux: Don't drop args if we auto-lookup cmd extension
If we automatically lookup the extension for a command and the user has supplied an argument to that command we incorrectly stamp the NUL byte after the extension, and not after the argument, thereby effectively erasing the argument. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r--com32/elflink/ldlinux/ldlinux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c
index da93c544..18915262 100644
--- a/com32/elflink/ldlinux/ldlinux.c
+++ b/com32/elflink/ldlinux/ldlinux.c
@@ -124,7 +124,7 @@ static const char *apply_extension(const char *kernel, const char *ext)
/* Copy the rest of the command line */
strcpy(k + len + elen, p);
- k[len + elen] = '\0';
+ k[len + elen + strlen(p)] = '\0';
return k;
}