[coreboot-gerrit] New patch to review for coreboot: 50ec6f1 cbfstool: Properly handle EOF in update_fit step

Alexandru Gagniuc (mr.nuke.me@gmail.com) gerrit at coreboot.org
Mon Dec 9 00:49:11 CET 2013


Alexandru Gagniuc (mr.nuke.me at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/4508

-gerrit

commit 50ec6f119e7243b983b618ce9826b8894eef43d0
Author: Alexandru Gagniuc <mr.nuke.me at gmail.com>
Date:   Sun Dec 8 17:46:40 2013 -0600

    cbfstool: Properly handle EOF in update_fit step
    
    The update_fit step would segfault when given microcode which was not NULL
    terminated. This is due to a bug where a counter was decremented too late.
    
    Change-Id: I840727add69379ffef75b694d90402ed89769e3b
    Signed-off-by: Alexandru Gagniuc <mr.nuke.me at gmail.com>
---
 util/cbfstool/fit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/cbfstool/fit.c b/util/cbfstool/fit.c
index 02cfaee..c76ba48 100644
--- a/util/cbfstool/fit.c
+++ b/util/cbfstool/fit.c
@@ -216,8 +216,8 @@ static int parse_microcode_blob(struct cbfs_image *image,
 
 		/* Proceed to next payload. */
 		current_offset += mcus[num_mcus].size;
-		num_mcus++;
 		file_length -= mcus[num_mcus].size;
+		num_mcus++;
 
 		/* Reached limit of FIT entries. */
 		if (num_mcus == *total_mcus)



More information about the coreboot-gerrit mailing list