From c4abf0b6ccbcbcbdc4406d65a31cf86ffbb188d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Tue, 18 Jun 2013 21:51:43 +0000 Subject: [PATCH] [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 svn path=/trunk/; revision=59255 --- reactos/win32ss/gdi/ntgdi/icm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reactos/win32ss/gdi/ntgdi/icm.c b/reactos/win32ss/gdi/ntgdi/icm.c index 54aa505382b..d06dfc2b5d1 100644 --- a/reactos/win32ss/gdi/ntgdi/icm.c +++ b/reactos/win32ss/gdi/ntgdi/icm.c @@ -23,6 +23,8 @@ IntGdiCreateColorSpace( HCOLORSPACE hCS; pCS = COLORSPACEOBJ_AllocCSWithHandle(); + if (pCS == NULL) return NULL; + hCS = pCS->BaseObject.hHmgr; pCS->lcsColorSpace = pLogColorSpace->lcsColorSpace;