From 642eed81c0a664504e6a1a33bff569b4fc428f0c Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Thu, 4 Oct 2018 02:57:15 -0400 Subject: [PATCH] allow using larger guards on large allocations --- malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/malloc.c b/malloc.c index dd7b794..3cd6c64 100644 --- a/malloc.c +++ b/malloc.c @@ -730,7 +730,7 @@ COLD __attribute__((constructor(101))) static void trigger_early_init(void) { } static size_t get_guard_size(struct random_state *state, size_t size) { - return (get_random_u64_uniform(state, size / PAGE_SIZE / 8) + 1) * PAGE_SIZE; + return (get_random_u64_uniform(state, size / PAGE_SIZE / 2) + 1) * PAGE_SIZE; } static void *allocate(size_t size) {