mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 14:49:22 +08:00
assert in kasan_set_poison() if size is zero
e.g. mm_realloc() => kasan_poison() => kasan_set_poison() _assert: Assertion failed p != ((void*)0): at file: kasan/kasan.c:239 task: nsh_main process: nsh_main 0x4402caa5 Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
@@ -233,6 +233,11 @@ static void kasan_set_poison(FAR const void *addr, size_t size,
|
||||
uintptr_t mask;
|
||||
int flags;
|
||||
|
||||
if (size == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
flags = spin_lock_irqsave(&g_lock);
|
||||
|
||||
p = kasan_mem_to_shadow(addr, size, &bit);
|
||||
|
||||
Reference in New Issue
Block a user