From 7917966ecac59f280b2657f399e277476fcdd64f Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Wed, 5 Dec 2018 02:45:24 -0500 Subject: [PATCH] avoid unnecessary GNU pointer arithmetic extension --- h_malloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/h_malloc.c b/h_malloc.c index cd44042..fdc0e92 100644 --- a/h_malloc.c +++ b/h_malloc.c @@ -381,13 +381,13 @@ static void *slot_pointer(size_t size, void *slab, size_t slot) { return (char *)slab + slot * size; } -static void write_after_free_check(const void *p, size_t size) { +static void write_after_free_check(const char *p, size_t size) { if (!WRITE_AFTER_FREE_CHECK) { return; } for (size_t i = 0; i < size; i += sizeof(u64)) { - if (*(const u64 *)(p + i)) { + if (*(const u64 *)(const void *)(p + i)) { fatal_error("detected write after free"); } }