Martin Roth has uploaded this change for review. ( https://review.coreboot.org/22900
Change subject: util/cbfstool: Check for NULL before dereference ......................................................................
util/cbfstool: Check for NULL before dereference
Fixed coverity issue: 1302455 - Dereference null return value
Change-Id: I59b908adc4d35f08fda8e4ad3f806714f2caeb65 Signed-off-by: Martin Roth martinroth@google.com --- M util/cbfstool/partitioned_file.c 1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/00/22900/1
diff --git a/util/cbfstool/partitioned_file.c b/util/cbfstool/partitioned_file.c index 7b4b003..9abd32a 100644 --- a/util/cbfstool/partitioned_file.c +++ b/util/cbfstool/partitioned_file.c @@ -196,6 +196,10 @@
const struct fmap_area *fmap_fmap_entry = fmap_find_area(file->fmap, SECTION_NAME_FMAP); + + if (!fmap_fmap_entry) + return NULL; + if ((long)fmap_fmap_entry->offset != fmap_region_offset) { ERROR("FMAP's '%s' section doesn't point back to FMAP start (did something corrupt this file?)\n", SECTION_NAME_FMAP);