Author: hbelusca
Date: Tue Jun 18 21:51:43 2013
New Revision: 59255

URL: http://svn.reactos.org/svn/reactos?rev=59255&view=rev
Log:
[WIN32K]
Check for NULL pointer returned by COLORSPACEOBJ_AllocCSWithHandle before 
dereferencing the returned pointer (the allocation function can return NULL in 
low memory conditions, leading to kernel crashes).
Adapted from a patch from Aleksandar Andrejevic.
CORE-7317 #resolve #comment Fixed in revision r59255, cheers :D

Modified:
    trunk/reactos/win32ss/gdi/ntgdi/icm.c

Modified: trunk/reactos/win32ss/gdi/ntgdi/icm.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/icm.c?rev=59255&r1=59254&r2=59255&view=diff
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/icm.c       [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/icm.c       [iso-8859-1] Tue Jun 18 
21:51:43 2013
@@ -23,6 +23,8 @@
     HCOLORSPACE hCS;
 
     pCS = COLORSPACEOBJ_AllocCSWithHandle();
+    if (pCS == NULL) return NULL;
+
     hCS = pCS->BaseObject.hHmgr;
 
     pCS->lcsColorSpace = pLogColorSpace->lcsColorSpace;


Reply via email to