summaryrefslogtreecommitdiffstats
path: root/spi25_statusreg.c
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2020-03-31 15:34:35 +0200
committerAngel Pons <th3fanbus@gmail.com>2020-04-25 15:16:24 +0000
commite0272e2b6f8860152d0edf72263a80426fd7d5e3 (patch)
tree722d2e87c2a1e30773963921fe68a4ef6e5a68c9 /spi25_statusreg.c
parent2ee489d7ef5b653c50522a8dad699eee622078ab (diff)
downloadflashrom-e0272e2b6f8860152d0edf72263a80426fd7d5e3.tar.gz
flashrom-e0272e2b6f8860152d0edf72263a80426fd7d5e3.tar.bz2
flashrom-e0272e2b6f8860152d0edf72263a80426fd7d5e3.zip
ft2232_spi.c: Improve handling of static buffer
If `buf` became NULL because of an error, subsequent calls to the `ft2232_spi_send_command` function with a smaller buffer size will result in a null pointer dereference. Add an additional null check before using `buf` to prevent that. Moreover, use `size_t` for the `bufsize` and `oldbufsize` variables, as it's what `realloc` uses. Change-Id: Idc4237ddca94c42ce2a930e6d00fd2d14e4f125c Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/39975 Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'spi25_statusreg.c')
0 files changed, 0 insertions, 0 deletions