Commit 76969a86 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Don't call local_unwind2 when Cookie equals MSVCRT_JMP_MAGIC in longjmp.

parent 16cc2b87
......@@ -1014,17 +1014,18 @@ void CDECL MSVCRT_longjmp(struct MSVCRT___JUMP_BUFFER *jmp, int retval)
if (jmp->Registration)
{
if (!IsBadReadPtr(&jmp->Cookie, sizeof(long)) &&
jmp->Cookie == MSVCRT_JMP_MAGIC && jmp->UnwindFunc)
if (IsBadReadPtr(&jmp->Cookie, sizeof(long)) || jmp->Cookie != MSVCRT_JMP_MAGIC)
{
msvcrt_local_unwind2((MSVCRT_EXCEPTION_FRAME*)jmp->Registration,
jmp->TryLevel, (void *)jmp->Ebp);
}
else if(jmp->UnwindFunc)
{
MSVCRT_unwind_function unwind_func;
unwind_func=(MSVCRT_unwind_function)jmp->UnwindFunc;
unwind_func(jmp);
}
else
msvcrt_local_unwind2((MSVCRT_EXCEPTION_FRAME*)jmp->Registration,
jmp->TryLevel, (void *)jmp->Ebp);
}
if (!retval)
......
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