summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/flashrom/layout.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/util/flashrom/layout.c b/util/flashrom/layout.c
index ef0958286f..e2be12e9a9 100644
--- a/util/flashrom/layout.c
+++ b/util/flashrom/layout.c
@@ -156,6 +156,11 @@ int read_romlayout(char *name)
#endif
tstr1 = strtok(tempstr, ":");
tstr2 = strtok(NULL, ":");
+ if (!tstr1 || !tstr2) {
+ fprintf(stderr, "Error parsing layout file.\n");
+ fclose(romlayout);
+ return 1;
+ }
rom_entries[romimages].start = strtol(tstr1, (char **)NULL, 16);
rom_entries[romimages].end = strtol(tstr2, (char **)NULL, 16);
rom_entries[romimages].included = 0;