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

Alexandre Julliard julliard at winehq.org
Mon Jan 31 11:26:16 CST 2011


Module: wine
Branch: master
Commit: c865b3f8e0ba194ff0178c23cc97f6a7668cb5b3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c865b3f8e0ba194ff0178c23cc97f6a7668cb5b3

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jan 31 14:18:30 2011 +0100

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

---

 dlls/ntdll/signal_i386.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c
index aff4509..f86c810 100644
--- a/dlls/ntdll/signal_i386.c
+++ b/dlls/ntdll/signal_i386.c
@@ -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;




More information about the wine-cvs mailing list