Anastasia Klimchuk has submitted this change. ( https://review.coreboot.org/c/flashrom/+/62725 )
Change subject: libflashrom.c: Fix unintialized value passed to function ......................................................................
libflashrom.c: Fix unintialized value passed to function
In function flash_layout_read_from_ifd variable chip_layout remains uninitialized if prepare_flash_access returns false. This uninitialized variable (which contains a garbage value) is passed to flashrom_layout_release. Thus initialize it with NULL. For completeness, also initialize dump_layout with NULL.
Change-Id: Iacbd7bf9cdf897cc2a732c1dc6568845a4ab804d Signed-off-by: Aarya Chaumal aarya.chaumal@gmail.com Reviewed-on: https://review.coreboot.org/c/flashrom/+/62725 Reviewed-by: Felix Singer felixsinger@posteo.net Reviewed-by: Edward O'Callaghan quasisec@chromium.org Reviewed-by: Nico Huber nico.h@gmx.de Reviewed-by: Anastasia Klimchuk aklm@chromium.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M libflashrom.c 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved Felix Singer: Looks good to me, approved Edward O'Callaghan: Looks good to me, approved Anastasia Klimchuk: Looks good to me, approved
diff --git a/libflashrom.c b/libflashrom.c index f2288fe..39b0c67 100644 --- a/libflashrom.c +++ b/libflashrom.c @@ -442,7 +442,7 @@ #ifndef __FLASHROM_LITTLE_ENDIAN__ return 6; #else - struct flashrom_layout *dump_layout, *chip_layout; + struct flashrom_layout *dump_layout = NULL, *chip_layout = NULL; int ret = 1;
void *const desc = malloc(0x1000);