diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index aff4509..e80a0af 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -2434,16 +2434,32 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer, { if (((void *)frame < NtCurrentTeb()->Tib.StackLimit) || ((void *)(frame + 1) >= NtCurrentTeb()->Tib.StackBase)) return 0; - frame = (ULONG *)*frame; + __TRY /* protect againts corrupted frame pointer */ + { + frame = (ULONG *)*frame; + } + __EXCEPT_PAGE_FAULT + { + return 0; + } + __ENDTRY } for (i = 0; i < count; i++) { if (((void *)frame < NtCurrentTeb()->Tib.StackLimit) || ((void *)(frame + 1) >= NtCurrentTeb()->Tib.StackBase)) break; - buffer[i] = (void *)frame[1]; - if (hash) *hash += frame[1]; - frame = (ULONG *)*frame; + __TRY /* protect againts corrupted frame pointer */ + { + buffer[i] = (void *)frame[1]; + if (hash) *hash += frame[1]; + frame = (ULONG *)*frame; + } + __EXCEPT_PAGE_FAULT + { + return i; + } + __ENDTRY } return i; }