Commit in reactos/ntoskrnl/ke/i386 on MAIN
exp.c+14-21.80 -> 1.81

- Try to avoid crashing when dumping out a corrupted stack.

reactos/ntoskrnl/ke/i386
exp.c 1.80 -> 1.81
diff -u -r1.80 -r1.81
--- exp.c	13 Jan 2004 03:23:11 -0000	1.80
+++ exp.c	24 Feb 2004 23:50:26 -0000	1.81
@@ -500,8 +500,20 @@
    Frame = (PULONG)Tf->Ebp;
    while (Frame != NULL)
      {
-       print_address((PVOID)Frame[1]);
-       Frame = (PULONG)Frame[0];
+       NTSTATUS Status;
+       PVOID Eip;
+       Status = MmSafeCopyFromUser(&Eip, Frame + 1, sizeof(Eip));
+       if (!NT_SUCCESS(Status))
+	 {
+	   DbgPrint("<INVALID>");
+	   break;
+	 }
+       print_address(Eip);
+       Status = MmSafeCopyFromUser(&Frame, Frame, sizeof(Frame));
+       if (!NT_SUCCESS(Status))
+	 {
+	   break;
+	 }
        i++;
        DbgPrint(" ");
      }
CVSspam 0.2.8