summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2020-06-30 10:24:50 -0400
committerJakob Kaivo <jkk@ung.org>2020-06-30 10:24:50 -0400
commitb2d5ec823a922b4710cad15283d589b2142b9fd8 (patch)
treeeffb7c7cbff4f1d4eae20e4b2268cae88c4adb73
parent8befa72f595bfef57592d12cd2321b310961ba4a (diff)
fix off-by-one in mprotect() section
-rw-r--r--src/mapalloc.c2
1 files changed, 1 insertions, 1 deletions
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);