[WIN32K]
authorJérôme Gardou <jerome.gardou@reactos.org>
Sun, 4 Sep 2011 15:58:48 +0000 (15:58 +0000)
committerJérôme Gardou <jerome.gardou@reactos.org>
Sun, 4 Sep 2011 15:58:48 +0000 (15:58 +0000)
- Avoid invalid memory write.
See issue #5969 for more details.

svn path=/trunk/; revision=53583

reactos/subsystems/win32/win32k/ntuser/misc.c

index 036c0ce..0bb0b30 100644 (file)
@@ -497,11 +497,14 @@ GetW32ThreadInfo(VOID)
     pti->pClientInfo = pci;
     _SEH2_TRY
     {
-        ProbeForWrite( Teb,
-                       sizeof(TEB),
-                       sizeof(ULONG));
+        if(Teb)
+        {    
+            ProbeForWrite( Teb,
+                           sizeof(TEB),
+                           sizeof(ULONG));
 
-        Teb->Win32ThreadInfo = (PW32THREAD) pti;
+            Teb->Win32ThreadInfo = (PW32THREAD) pti;
+        }
 
         pci->ppi = ppi;
         pci->fsHooks = pti->fsHooks;