[WIN32K]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 14 Sep 2014 12:33:03 +0000 (12:33 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 14 Sep 2014 12:33:03 +0000 (12:33 +0000)
Prevent NULL pointer dereference and fix a compiler warning

svn path=/trunk/; revision=64143

reactos/win32ss/gdi/ntgdi/gdidbg.c

index a90ee69..92dace0 100644 (file)
@@ -324,12 +324,12 @@ DbgGdiHTIntegrityCheck()
                                r = 0;
                                DPRINT1("Used entry has KernelData == 0\n");
                        }
-                       if (pEntry->KernelData <= MmHighestUserAddress)
+                       else if (pEntry->KernelData <= MmHighestUserAddress)
                        {
                                r = 0;
                                DPRINT1("Used entry invalid KernelData\n");
                        }
-                       if (((POBJ)(pEntry->KernelData))->hHmgr != Handle)
+                       else if (((POBJ)(pEntry->KernelData))->hHmgr != Handle)
                        {
                                r = 0;
                                DPRINT1("Used entry %lu, has invalid hHmg %p (expected: %p)\n",
@@ -606,7 +606,7 @@ DbgAddDebugChannel(PPROCESSINFO ppi, WCHAR* channel, WCHAR* level, WCHAR op)
     }
 
     iChannel = ChannelEntry->Id;
-    ASSERT(iChannel >= 0 && iChannel < DbgChCount);
+    ASSERT(iChannel < DbgChCount);
 
     if(level == NULL || *level == L'\0' ||wcslen(level) == 0 )
         iLevel = MAX_LEVEL;