ldlinux: Dynamically alloc memory for kernel and initrd filenames
commit96f02b37a56382c0e297fdbe4b7002f8ffb8829c
authorMatt Fleming <matt.fleming@intel.com>
Fri, 4 Jan 2013 19:16:39 +0000 (4 19:16 +0000)
committerMatt Fleming <matt.fleming@intel.com>
Fri, 4 Jan 2013 19:52:26 +0000 (4 19:52 +0000)
tree26522588ff2efa74af1e410ff8cbbab77cbcc4a1
parente1680d483ead4a0afdc672ce9c5c7942941f985b
ldlinux: Dynamically alloc memory for kernel and initrd filenames

Absolutely no bounds checking is performed when copying filenames to
'cmdline_buf' and 'initrd_name' which means that sufficiently long
strings will scribble over the stack. At best, the files will simply
fail to load because the name is garbled.

Allocate space for the cmdline at runtime to avoid these overflow
problems.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
com32/elflink/ldlinux/kernel.c