[ros-diffs] [greatlrd] 20422: InitTimerImpl did not check for NULL pointer when it alloc memory.

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Thu Dec 29 15:59:03 CET 2005


InitTimerImpl did not check for NULL pointer when it alloc memory.
Modified: trunk/reactos/subsys/win32k/ntuser/timer.c
  _____  

Modified: trunk/reactos/subsys/win32k/ntuser/timer.c
--- trunk/reactos/subsys/win32k/ntuser/timer.c	2005-12-29 13:43:25 UTC
(rev 20421)
+++ trunk/reactos/subsys/win32k/ntuser/timer.c	2005-12-29 13:53:35 UTC
(rev 20422)
@@ -181,8 +181,13 @@

 
    ExInitializeFastMutex(&Mutex);
 
-   BitmapBytes = ROUND_UP(NUM_WINDOW_LESS_TIMERS, sizeof(ULONG) * 8) /
8;
+   BitmapBytes = ROUND_UP(NUM_WINDOW_LESS_TIMERS, sizeof(ULONG) * 8) /
8;   
    WindowLessTimersBitMapBuffer = ExAllocatePoolWithTag(PagedPool,
BitmapBytes, TAG_TIMERBMP);
+   if (WindowLessTimersBitMapBuffer == NULL)
+   {
+      return STATUS_UNSUCCESSFUL;
+   }      
+   
    RtlInitializeBitMap(&WindowLessTimersBitMap,
                        WindowLessTimersBitMapBuffer,
                        BitmapBytes * 8);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20051229/924fd6a5/attachment.html


More information about the Ros-diffs mailing list