mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 15:12:36 +02:00
spi25.c: Add a null check
Change-Id: I5fcc23d81b8404af90768afa2954509bf334ab2c Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/39974 Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
94991d83e4
commit
2ee489d7ef
2
spi25.c
2
spi25.c
@ -570,6 +570,8 @@ static int spi_write_cmd(struct flashctx *const flash, const uint8_t op,
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user