summaryrefslogtreecommitdiff
path: root/tests/lib
diff options
context:
space:
mode:
authorJakub Czapiga <jacz@semihalf.com>2021-04-06 18:27:30 +0200
committerPatrick Georgi <pgeorgi@google.com>2021-04-11 21:05:25 +0000
commit13145e5d18229b5c05b93d23b5243d7e4505e1f2 (patch)
treeb43c046ad9200e892156db99e595e12be25c70ac /tests/lib
parent69e3fde5e4b974342dc8be93dd5ec18096e73ebb (diff)
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>
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/malloc-test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/lib/malloc-test.c b/tests/lib/malloc-test.c
index fefacbb92b..b70de06ae1 100644
--- a/tests/lib/malloc-test.c
+++ b/tests/lib/malloc-test.c
@@ -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);
}