summaryrefslogtreecommitdiff
path: root/util/cbfstool
diff options
context:
space:
mode:
Diffstat (limited to 'util/cbfstool')
-rw-r--r--util/cbfstool/partitioned_file.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/util/cbfstool/partitioned_file.c b/util/cbfstool/partitioned_file.c
index 7b4b0035f6..9abd32aab6 100644
--- a/util/cbfstool/partitioned_file.c
+++ b/util/cbfstool/partitioned_file.c
@@ -196,6 +196,10 @@ partitioned_file_t *partitioned_file_reopen(const char *filename,
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);