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 cbfstool: Update example file. 2013-02-04 11:12:15 +01:00
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 cbfstool: Use cbfs_image API for "print" command. 2013-02-05 22:25:13 +01:00
cbfs_image.c Correct spelling of shadow, setting and memory 2013-08-16 22:25:56 +02:00
cbfs_image.h cbfstool locate: Implement alignment switch --align/-a 2013-03-20 05:47:32 +01:00
cbfstool.c Add a (b)zImage parser to cbfstool 2013-08-31 08:58:34 +02:00
coff.h GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00
common.c cbfstool: Add buffer management API. 2013-02-05 22:24:45 +01:00
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 GPLv2 notice: Unify all files to just use one space in »MA 02110-1301« 2013-03-01 10:16:08 +01:00
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