Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/67723 )
Change subject: cli_classic.c: Early init of layout obscures invalid memory access ......................................................................
cli_classic.c: Early init of layout obscures invalid memory access
BUG=b:247055486 TEST=builds
Change-Id: I3df61b873da27f6945d60916a1c3713dedfc3924 Signed-off-by: Edward O'Callaghan quasisec@google.com --- M cli_classic.c 1 file changed, 17 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/23/67723/1
diff --git a/cli_classic.c b/cli_classic.c index bac31d1..e384845 100644 --- a/cli_classic.c +++ b/cli_classic.c @@ -538,7 +538,7 @@ bool dont_verify_it = false, dont_verify_all = false; bool list_supported = false; bool show_progress = false; - struct flashrom_layout *layout = NULL; + struct flashrom_layout *layout; static const struct programmer_entry *prog = NULL; enum { OPTION_IFD = 0x0100, @@ -1105,6 +1105,9 @@ flashrom_flash_getsize(fill_flash)) || process_include_args(layout, include_args))) { ret = 1; goto out_shutdown; + } else { + layout = NULL; + msg_gdbg("Valid layout could not be found without image.\n"); } flashrom_layout_set(fill_flash, layout);