From 7c9b7f4d54d592d69fc030da43bcdff5b52e63cb Mon Sep 17 00:00:00 2001 From: Shravan Narayan Date: Tue, 9 Apr 2024 18:28:50 -0500 Subject: [PATCH] Use a tighter sanity check of 16gb max mmap and ensure this lines up with comment --- src/wasm2c_rt_mem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wasm2c_rt_mem.c b/src/wasm2c_rt_mem.c index 1bdf6f7..c13568e 100644 --- a/src/wasm2c_rt_mem.c +++ b/src/wasm2c_rt_mem.c @@ -328,8 +328,8 @@ static void* os_mmap(void* hint, size_t size, int prot, int flags) /* integer overflow */ return NULL; - if (request_size > 16 * (uint64_t)UINT32_MAX) - /* At most 16 G is allowed */ + if (request_size > 4 * (uint64_t)UINT32_MAX) + /* Sanity check: At most 16 G is allowed */ return NULL; if (prot & MMAP_PROT_READ)