Felix Singer submitted this change.

View Change


Approvals: build bot (Jenkins): Verified Felix Singer: Looks good to me, approved Angel Pons: Looks good to me, approved
bitbang_spi.c: Fix unchecked heap allocation

Change-Id: Ib64b1fe67fa1874875453ab9e1700e468c579e7c
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68775
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
---
M bitbang_spi.c
1 file changed, 17 insertions(+), 0 deletions(-)

diff --git a/bitbang_spi.c b/bitbang_spi.c
index 10c1087..5e4b566 100644
--- a/bitbang_spi.c
+++ b/bitbang_spi.c
@@ -165,6 +165,9 @@
}

struct bitbang_spi_master_data *data = calloc(1, sizeof(*data));
+ if (!data)
+ return ERROR_FATAL;
+
data->master = master;
if (spi_data)
data->spi_data = spi_data;

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ib64b1fe67fa1874875453ab9e1700e468c579e7c
Gerrit-Change-Number: 68775
Gerrit-PatchSet: 2
Gerrit-Owner: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Felix Singer <felixsinger@posteo.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged