Skip to content

Commit

Permalink
Use a tighter sanity check of 16gb max mmap and ensure this lines up …
Browse files Browse the repository at this point in the history
…with comment
  • Loading branch information
shravanrn committed Apr 9, 2024
1 parent c0d2ba2 commit 7c9b7f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wasm2c_rt_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7c9b7f4

Please sign in to comment.