diff options
| author | Matt Fleming <matt.fleming@intel.com> | 2012-12-07 11:33:45 +0000 |
|---|---|---|
| committer | Matt Fleming <matt.fleming@intel.com> | 2012-12-07 11:33:45 +0000 |
| commit | 10f6cf6eef0a7da7dad1933efdbfb101155792d0 (patch) | |
| tree | d8ee3bfc6e55e739e0f135cd6d945955c670dd46 /com32/lib/syslinux | |
| parent | 35928ee37da523e5f992cc462a4a4193d0bfaa4c (diff) | |
| parent | ddb10ce99c327888ade4d2ba3e4c50ad12aaa059 (diff) | |
| download | syslinux-6.00-pre3.tar.gz | |
Merge tag 'syslinux-5.00' into firmwaresyslinux-6.00-pre3
Conflicts:
Makefile
com32/elflink/ldlinux/Makefile
com32/lib/sys/module/elf_module.c
core/cleanup.c
core/comboot.inc
core/conio.c
core/fs/fs.c
core/init.c
core/mem/free.c
core/mem/malloc.c
core/timer.inc
diag/geodsp/Makefile
extlinux/main.c
mk/embedded.mk
modules/Makefile
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'com32/lib/syslinux')
| -rw-r--r-- | com32/lib/syslinux/runimage.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/com32/lib/syslinux/runimage.c b/com32/lib/syslinux/runimage.c index 4391114c..d3db75f3 100644 --- a/com32/lib/syslinux/runimage.c +++ b/com32/lib/syslinux/runimage.c @@ -42,26 +42,22 @@ extern unsigned int ipappend; void syslinux_run_kernel_image(const char *filename, const char *cmdline, uint32_t ipappend_flags, uint32_t type) { - char *bbfilename = NULL; char *bbcmdline = NULL; + size_t len; + int rv; - - bbfilename = lstrdup(filename); - if (!bbfilename) - goto fail; - - bbcmdline = lstrdup(cmdline); + /* +2 for NULL and space */ + len = strlen(filename) + strlen(cmdline) + 2; + bbcmdline = malloc(len); if (!bbcmdline) - goto fail; + return; + + rv = snprintf(bbcmdline, len, "%s %s", filename, cmdline); + if (rv == -1 || (size_t)rv >= len) + return; if (syslinux_filesystem() == SYSLINUX_FS_PXELINUX) ipappend = ipappend_flags; - execute(bbfilename, type); - -fail: - if (bbcmdline) - lfree(bbcmdline); - if (bbfilename) - lfree(bbfilename); + execute(bbcmdline, type); } |
