commit | c92f6876ed82488365c3ef1c59dd4669eb512527 | [log] [tgz] |
---|---|---|
author | Angel Pons <th3fanbus@gmail.com> | Tue Mar 31 15:32:10 2020 +0200 |
committer | Nico Huber <nico.h@gmx.de> | Fri Jan 13 01:34:15 2023 +0000 |
tree | b1926b71b105e94f826c646e13d85d84a295e4e5 | |
parent | a60f641a7f8b1a4cd602eecb8ddc247e40777400 [diff] |
spi25.c: Add a null check Change-Id: I5fcc23d81b8404af90768afa2954509bf334ab2c Signed-off-by: Angel Pons <th3fanbus@gmail.com> Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/39974 Original-Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Original-Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/71734 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
diff --git a/spi25.c b/spi25.c index 734df28..b13318b 100644 --- a/spi25.c +++ b/spi25.c
@@ -441,6 +441,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;