Make stack check work if stack is a small value.
This commit is contained in:
parent
f1853ba186
commit
cee9a0f2a3
|
@ -761,7 +761,8 @@ static EXCEPTION_RECORD *setup_exception( SIGCONTEXT *sigcontext, raise_func fun
|
||||||
server_abort_thread(1);
|
server_abort_thread(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((char *)(stack - 1) < (char *)NtCurrentTeb()->Tib.StackLimit + 4096 ||
|
if (stack - 1 > stack || /* check for overflow in subtraction */
|
||||||
|
(char *)(stack - 1) < (char *)NtCurrentTeb()->Tib.StackLimit + 4096 ||
|
||||||
(char *)stack > (char *)NtCurrentTeb()->Tib.StackBase)
|
(char *)stack > (char *)NtCurrentTeb()->Tib.StackBase)
|
||||||
{
|
{
|
||||||
UINT diff = (char *)NtCurrentTeb()->Tib.StackLimit + 4096 - (char *)stack;
|
UINT diff = (char *)NtCurrentTeb()->Tib.StackLimit + 4096 - (char *)stack;
|
||||||
|
|
Loading…
Reference in New Issue