diff options
author | Angel Pons <th3fanbus@gmail.com> | 2020-03-31 15:32:10 +0200 |
---|---|---|
committer | Angel Pons <th3fanbus@gmail.com> | 2020-04-25 15:16:17 +0000 |
commit | 2ee489d7ef5b653c50522a8dad699eee622078ab (patch) | |
tree | b2bbfc91c0dbd6344de271121dcff7efd9d66067 | |
parent | 94991d83e47453367819491fa7f3c9ff4ff0d68d (diff) | |
download | flashrom-2ee489d7ef5b653c50522a8dad699eee622078ab.tar.gz flashrom-2ee489d7ef5b653c50522a8dad699eee622078ab.tar.bz2 flashrom-2ee489d7ef5b653c50522a8dad699eee622078ab.zip |
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>
-rw-r--r-- | spi25.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; |