some case from win32k can call to RtlClearAllBits with NULL pointer. and check for...
authorMagnus Olsen <magnus@greatlord.com>
Thu, 29 Dec 2005 13:43:25 +0000 (13:43 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Thu, 29 Dec 2005 13:43:25 +0000 (13:43 +0000)
svn path=/trunk/; revision=20421

reactos/lib/rtl/bitmap.c

index e8db64e..61fa957 100644 (file)
@@ -125,9 +125,15 @@ RtlAreBitsSet(PRTL_BITMAP BitMapHeader,
 VOID NTAPI
 RtlClearAllBits(IN OUT PRTL_BITMAP BitMapHeader)
 {
-    memset(BitMapHeader->Buffer,
-          0x00,
-          ROUND_UP(BitMapHeader->SizeOfBitMap, 8) / 8);
+   if (BitMapHeader != NULL)
+   { 
+     if (BitMapHeader->Buffer != NULL)
+     {
+        memset(BitMapHeader->Buffer,
+                  0x00,
+                  ROUND_UP(BitMapHeader->SizeOfBitMap, 8) / 8);
+     }
+   }
 }