EngSetPointerShape did not check for NULL pointer when it alloc memmory.
authorMagnus Olsen <magnus@greatlord.com>
Thu, 29 Dec 2005 10:53:01 +0000 (10:53 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Thu, 29 Dec 2005 10:53:01 +0000 (10:53 +0000)
svn path=/trunk/; revision=20415

reactos/subsys/win32k/eng/mouse.c

index e7b1a2d..3ae0161 100644 (file)
@@ -389,6 +389,11 @@ EngSetPointerShape(
       PBYTE Bits;
 
       Bits = EngAllocMem(0, psoColor->cjBits, TAG_MOUSE);
+      if (Bits == NULL)
+      {
+          return SPS_ERROR;
+      }
+      
       memcpy(Bits, psoColor->pvBits, psoColor->cjBits);
 
       pgp->ColorSurface = (HSURF)EngCreateBitmap(pgp->Size,
@@ -407,6 +412,11 @@ EngSetPointerShape(
       Size.cx = pgp->Size.cx;
       Size.cy = pgp->Size.cy << 1;
       Bits = EngAllocMem(0, psoMask->cjBits, TAG_MOUSE);
+      if (Bits == NULL)
+      {
+          return SPS_ERROR;
+      }
+      
       memcpy(Bits, psoMask->pvBits, psoMask->cjBits);
 
       pgp->MaskSurface = (HSURF)EngCreateBitmap(Size,