tests/lib/malloc-test: Fix possible memory overrun

Coverity reported false-positive possible memory overrun
in setup_calloc_test(). Change memset address to use actual
buffer instead of pointer stored in symbol value in order
to silence Coverity.

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Change-Id: I19f0718c657d565e515157e66367573e08f51254
Found-by: Coverity CID 1452005
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52136
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Jakub Czapiga 2021-04-06 18:27:30 +02:00 committed by Patrick Georgi
parent 69e3fde5e4
commit 13145e5d18
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ static int setup_test(void **state)
static int setup_calloc_test(void **state)
{
memset(&_heap, 0xFF, TEST_HEAP_SZ);
memset(_test_heap, 0xFF, TEST_HEAP_SZ);
return setup_test(state);
}