coreboot-kgpe-d16/util/cbfstool
Alexandru Gagniuc f87c20a00d cbfstool: Properly handle EOF in update_fit step
During the update_fit step, 'file_length' is used to determine how many
bytes are left in the CBFS file. It was decremented in a loop from an
array 'mcus[num_mcus].size', but 'num_mcus' was incremented right before.
Since 'mcus' is memset(0) externally, 'file_length' was never decremented.

The loop exited when it reached a dummy terminator, usually 48 bytes of 0
which are internationally added to microcode blobs in coreboot. However,
if that terminator is removed, the loop doesn't stop and continues until
it segfaults.

Change-Id: I840727add69379ffef75b694d90402ed89769e3b
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-on: http://review.coreboot.org/4508
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@google.com>
2013-12-09 17:34:25 +01:00
..
lzma Fix whitespace leaked into tree 2013-09-17 21:04:35 +02:00
EXAMPLE
Makefile Add a (b)zImage parser to cbfstool 2013-08-31 08:58:34 +02:00
Makefile.inc Add a (b)zImage parser to cbfstool 2013-08-31 08:58:34 +02:00
cbfs-mkpayload.c Add a (b)zImage parser to cbfstool 2013-08-31 08:58:34 +02:00
cbfs-mkstage.c cbfstool: cbfs-mkstage.c: Free `buffer` on error path 2013-04-12 20:22:39 +02:00
cbfs-payload-linux.c Add a (b)zImage parser to cbfstool 2013-08-31 08:58:34 +02:00
cbfs.h
cbfs_image.c Correct spelling of shadow, setting and memory 2013-08-16 22:25:56 +02:00
cbfs_image.h
cbfstool.c Add a (b)zImage parser to cbfstool 2013-08-31 08:58:34 +02:00
coff.h
common.c
common.h Add a (b)zImage parser to cbfstool 2013-08-31 08:58:34 +02:00
compress.c cbfstool: Replace C++ code with C code 2013-04-03 02:35:28 +02:00
elf.h cbfstool: add a constant for the aarch64 2013-11-18 16:58:58 +01:00
fit.c cbfstool: Properly handle EOF in update_fit step 2013-12-09 17:34:25 +01:00
fit.h cbfstool: Add update-fit command 2013-03-27 01:25:12 +01:00
fv.h
linux.h Add a (b)zImage parser to cbfstool 2013-08-31 08:58:34 +02:00
linux_trampoline.c Add a (b)zImage parser to cbfstool 2013-08-31 08:58:34 +02:00
swab.h