Skip to content

Commit fd65433

Browse files
Fix integer overflow in validateVirtualMemorySpace
Addresses a false positive error `Insufficient contigious virtual memory space` when setting memory allocation at 2048-4096MB Signed-off-by: Duy Tran <40482367+khanhduytran0@users.noreply.github.com>
1 parent cb55bec commit fd65433

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Natives/JavaLauncher.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
extern char **environ;
2222

23-
BOOL validateVirtualMemorySpace(int size) {
23+
BOOL validateVirtualMemorySpace(size_t size) {
2424
size <<= 20; // convert to MB
2525
void *map = mmap(0, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
2626
// check if process successfully maps and unmaps a contiguous range

0 commit comments

Comments
 (0)