ntdll: Fix frame address check in RtlCaptureStackBackTrace to match what RtlUnwind does.

This commit is contained in:
Alexandre Julliard 2011-01-31 14:18:30 +01:00
parent f9e1943de8
commit c865b3f8e0
1 changed files with 4 additions and 2 deletions

View File

@ -2433,14 +2433,16 @@ USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer,
while (skip--)
{
if (((void *)frame < NtCurrentTeb()->Tib.StackLimit) ||
((void *)(frame + 1) >= NtCurrentTeb()->Tib.StackBase)) return 0;
((void *)(frame + 1) >= NtCurrentTeb()->Tib.StackBase) ||
((ULONG_PTR)frame & 3)) return 0;
frame = (ULONG *)*frame;
}
for (i = 0; i < count; i++)
{
if (((void *)frame < NtCurrentTeb()->Tib.StackLimit) ||
((void *)(frame + 1) >= NtCurrentTeb()->Tib.StackBase)) break;
((void *)(frame + 1) >= NtCurrentTeb()->Tib.StackBase) ||
((ULONG_PTR)frame & 3)) break;
buffer[i] = (void *)frame[1];
if (hash) *hash += frame[1];
frame = (ULONG *)*frame;