Commit cee9a0f2 authored by Glenn Wurster's avatar Glenn Wurster Committed by Alexandre Julliard

Make stack check work if stack is a small value.

parent f1853ba1
......@@ -761,7 +761,8 @@ static EXCEPTION_RECORD *setup_exception( SIGCONTEXT *sigcontext, raise_func fun
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)
{
UINT diff = (char *)NtCurrentTeb()->Tib.StackLimit + 4096 - (char *)stack;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment