Edward O'Callaghan submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved Anastasia Klimchuk: Looks good to me, but someone else must approve
dummyflasher.c: Fix use-after-free issue

Issue accidentally introduced in commit e3707bbf4.

BUG=none
BRANCH=none
TEST=builds

Change-Id: Ie12d6474ef5a7bb1afbbb9ec50b31b577da1a81b
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/55014
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
---
M dummyflasher.c
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dummyflasher.c b/dummyflasher.c
index b7cfab8..325263d 100644
--- a/dummyflasher.c
+++ b/dummyflasher.c
@@ -700,12 +700,13 @@
tmp = extract_programmer_param("spi_write_256_chunksize");
if (tmp) {
data->spi_write_256_chunksize = strtoul(tmp, &endptr, 0);
- free(tmp);
if (*endptr != '\0' || data->spi_write_256_chunksize < 1) {
msg_perr("invalid spi_write_256_chunksize\n");
+ free(tmp);
return 1;
}
}
+ free(tmp);

tmp = extract_programmer_param("spi_blacklist");
if (tmp) {

To view, visit change 55014. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ie12d6474ef5a7bb1afbbb9ec50b31b577da1a81b
Gerrit-Change-Number: 55014
Gerrit-PatchSet: 2
Gerrit-Owner: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter@mailbox.org>
Gerrit-MessageType: merged