cbfstool: Fix update-fit command

Regression in commit 3fcde22 caused parse_microcode_blob() to access
data outside cpu_microcode_blob.bin file in CBFS and create invalid
Intel Firmware Interface Table entries.

Change-Id: I1a687060084c2acd6cac5f5053b74a332b4ac714
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/7958
Tested-by: build bot (Jenkins)
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
Kyösti Mälkki 2014-12-27 13:08:54 +02:00
parent 78c622443e
commit f9b8ed86dd
1 changed files with 1 additions and 1 deletions

View File

@ -207,8 +207,8 @@ static int parse_microcode_blob(struct cbfs_image *image,
uint32_t current_offset;
uint32_t file_length;
current_offset = (int)((char *)mcode_file - image->buffer.data);
fit_header(mcode_file, &current_offset, &file_length);
current_offset += (int)((char *)mcode_file - image->buffer.data);
num_mcus = 0;
while (file_length > sizeof(struct microcode_header))