UPSTREAM: serprog.c: Avoid calling memcpy with NULL pointer arguments
In function sp_stream_buffer_op, the variable parms might be NULL when
passed to memcpy. Although, since parmlen is also 0 at that time I
don't think it would make much difference. Still, add a NULL check
before calling memcpy to be safe.
BUG=none
BRANCH=none
TEST=none
Original-Change-Id: I850123237e328f9548ba7f77a01888be2cbc9e7b
Original-Signed-off-by: Aarya Chaumal <aarya.chaumal@gmail.com>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/62726
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
Original-Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Original-Reviewed-by: Thomas Heijligen <src@posteo.de>
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
(cherry picked from commit c829a48e198d723f0e6ae1ff6d6f820eb085711d)
Change-Id: I40818a3a186837a72d7ee8f6906e4632c0757c49
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/flashrom/+/3641346
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Tested-by: Edward O'Callaghan <quasisec@chromium.org>
Commit-Queue: Edward O'Callaghan <quasisec@chromium.org>
1 file changed