From a85e1a29e35a5b957c4d8bad603b1864709f8f92 Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Tue, 17 Sep 2019 16:18:34 +0900 Subject: [PATCH] Make kmalloc() wipe the newly allocated memory --- kernel/arch/heap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/arch/heap.c b/kernel/arch/heap.c index 6ce6d17..fa83b36 100644 --- a/kernel/arch/heap.c +++ b/kernel/arch/heap.c @@ -168,6 +168,9 @@ void* kmalloc(u32_t size) _kheap.h_free -= sizeof(*new); } + /* wipe the memory in case the caller forgets to */ + memset(ret_val, 0, size); + _kheap.h_free -= size; break; -- 2.47.3