Commit 5881d91c authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

ntdll: Avoid crashing in check_atl_thunk if an execution exception was raised with a bad address.

parent c88bbd80
......@@ -828,14 +828,26 @@ struct atl_thunk
*/
static BOOL check_atl_thunk( EXCEPTION_RECORD *rec, CONTEXT *context )
{
struct atl_thunk *thunk = (struct atl_thunk *)rec->ExceptionInformation[1];
const struct atl_thunk *thunk = (const struct atl_thunk *)rec->ExceptionInformation[1];
BOOL ret = FALSE;
if (thunk->movl != 0x042444c7 || thunk->jmp != 0xe9) return FALSE;
__TRY
{
if (thunk->movl == 0x042444c7 && thunk->jmp == 0xe9)
{
*((DWORD *)context->Esp + 1) = thunk->this;
context->Eip = (DWORD_PTR)(&thunk->func + 1) + thunk->func;
TRACE( "emulating ATL thunk at %p, func=%08lx arg=%08lx\n",
thunk, context->Eip, *((DWORD *)context->Esp + 1) );
return TRUE;
ret = TRUE;
}
}
__EXCEPT_PAGE_FAULT
{
return FALSE;
}
__ENDTRY
return ret;
}
......
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