From b2d5ec823a922b4710cad15283d589b2142b9fd8 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 30 Jun 2020 10:24:50 -0400 Subject: fix off-by-one in mprotect() section --- src/mapalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/mapalloc.c b/src/mapalloc.c index 00af064..69e87fe 100644 --- a/src/mapalloc.c +++ b/src/mapalloc.c @@ -70,7 +70,7 @@ void *map_malloc(size_t n) } mprotect(ptr, PAGESIZE, PROT_NONE); - mprotect((char*)ptr + alloc - (2 * PAGESIZE), PAGESIZE, PROT_NONE); + mprotect((char*)ptr + alloc - PAGESIZE, PAGESIZE, PROT_NONE); /* struct bucket *b = get_bucket(ptr); -- cgit v1.2.1