about summary refs log tree commit diff stats
path: root/src/libtools
diff options
context:
space:
mode:
Diffstat (limited to 'src/libtools')
-rwxr-xr-xsrc/libtools/threads32.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libtools/threads32.c b/src/libtools/threads32.c
index 2378b3a6..ae406440 100755
--- a/src/libtools/threads32.c
+++ b/src/libtools/threads32.c
@@ -207,6 +207,11 @@ EXPORT int my32_pthread_create(x64emu_t *emu, void* t, void* attr, void* start_r
 		own = 1;
 	}
 
+	if((uintptr_t)stack>=0x100000000LL) {
+		if(own) munmap(stack, stacksize);
+		return EAGAIN;
+	}
+
 	emuthread_t *et = (emuthread_t*)box_calloc(1, sizeof(emuthread_t));
     x64emu_t *emuthread = NewX64Emu(my_context, (uintptr_t)start_routine, (uintptr_t)stack, stacksize, own);
 	SetupX64Emu(emuthread, emu);