[syslinux:elflink] ldlinux: Don' t drop args if we auto-lookup cmd extension

syslinux-bot for Matt Fleming matt.fleming at intel.com
Fri May 4 12:15:05 PDT 2012


Commit-ID:  254db41a8b0cf5f92bd6ff3f3e20bbd64ede071e
Gitweb:     http://www.syslinux.org/commit/254db41a8b0cf5f92bd6ff3f3e20bbd64ede071e
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Tue, 1 May 2012 16:00:12 +0100
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Tue, 1 May 2012 16:00:12 +0100

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 at intel.com>

---
 com32/elflink/ldlinux/ldlinux.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c
index da93c54..1891526 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;
 }


More information about the Syslinux-commits mailing list