From 1fb3687eaa0ccbd95ac7c274f0cb42a6d8bc4a03 Mon Sep 17 00:00:00 2001 From: wangmingrong1 Date: Wed, 18 Sep 2024 10:45:08 +0800 Subject: [PATCH] kasantest.c: fix the size passed by mm_initialize is incorrect Signed-off-by: wangmingrong1 --- testing/kasantest/kasantest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testing/kasantest/kasantest.c b/testing/kasantest/kasantest.c index bfaf846ec..8be3ee273 100644 --- a/testing/kasantest/kasantest.c +++ b/testing/kasantest/kasantest.c @@ -294,20 +294,20 @@ static bool test_algorithm_perf(FAR struct mm_heap_s *heap, size_t size) #ifdef CONFIG_MM_KASAN_GLOBAL static bool test_global_underflow(FAR struct mm_heap_s *heap, size_t size) { - memset(g_kasan_globals - 31, 0x12, sizeof(g_kasan_globals)); + memset(g_kasan_globals - 1, 0x12, sizeof(g_kasan_globals)); return false; } static bool test_global_overflow(FAR struct mm_heap_s *heap, size_t size) { - memset(g_kasan_globals, 0xef, sizeof(g_kasan_globals) + 31); + memset(g_kasan_globals + sizeof(g_kasan_globals), 0xef, 1); return false; } #endif static int run_test(FAR const testcase_t *test) { - size_t heap_size = sizeof(g_kasan_heap); + size_t heap_size = sizeof(g_kasan_heap) - sizeof(run_t); FAR char *argv[3]; FAR run_t *run; int status;