From 15f90899eb6cd227bb7eca647b90600a80c30dea Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 20 Dec 2024 11:21:40 +0100 Subject: [BOX32] Don't abort when stack pointer is not correct on new thread, but return an error --- src/libtools/threads32.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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); -- cgit 1.4.1