From e4aa83204502df229def8f1b639039dfa5fe33a1 Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Fri, 24 Nov 2023 21:47:28 +0100 Subject: LibC: Fill new allocations with random data and fix a bug The bug was noticed as a result of this new randomization of allocations. --- userland/libc/malloc/malloc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'userland/libc/malloc/malloc.c') diff --git a/userland/libc/malloc/malloc.c b/userland/libc/malloc/malloc.c index 4c9621b..79d1d5f 100644 --- a/userland/libc/malloc/malloc.c +++ b/userland/libc/malloc/malloc.c @@ -171,6 +171,7 @@ void *int_malloc(size_t s, int align) { rc = c; return rc; } + randomfill(rc, s); return rc; } @@ -221,6 +222,7 @@ void free(void *p) { if (h->flags & IS_FREE) return; + randomfill(p, h->size); h->flags |= IS_FREE; merge_headers(h); } -- cgit v1.2.3