1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 23:22:37 +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:
Angel Pons 2020-03-31 15:32:10 +02:00
parent 94991d83e4
commit 2ee489d7ef

View File

@ -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;