Angel Pons has uploaded this change for review.

View Change

spi25.c: Add a null check

Change-Id: I5fcc23d81b8404af90768afa2954509bf334ab2c
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
---
M spi25.c
1 file changed, 2 insertions(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/74/39974/1
diff --git a/spi25.c b/spi25.c
index 2a1d492..0a939e7 100644
--- a/spi25.c
+++ b/spi25.c
@@ -427,6 +427,8 @@
msg_cerr("%s called for too long a write\n", __func__);
return 1;
}
+ if (!out_bytes && out_len > 0)
+ return 1;

memcpy(cmd + 1 + addr_len, out_bytes, out_len);
cmds[1].writecnt = 1 + addr_len + out_len;

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I5fcc23d81b8404af90768afa2954509bf334ab2c
Gerrit-Change-Number: 39974
Gerrit-PatchSet: 1
Gerrit-Owner: Angel Pons <th3fanbus@gmail.com>
Gerrit-MessageType: newchange