Check for NULL pointer returned by PEN_AllocPenWithHandle before dereferencing the returned pointer (the allocation function can return NULL in low memory conditions, leading to kernel crashes).

svn path=/trunk/; revision=59257
This commit is contained in:
Hermès Bélusca-Maïto 2013-06-18 22:14:50 +00:00
parent 99f4087daa
commit 895a9ab679

View file

@ -107,7 +107,10 @@ IntCreateStockPen(DWORD dwPenStyle,
ULONG ulColor)
{
HPEN hPen;
PBRUSH pbrushPen = PEN_AllocPenWithHandle();
PBRUSH pbrushPen;
pbrushPen = PEN_AllocPenWithHandle();
if (pbrushPen == NULL) return NULL;
if ((dwPenStyle & PS_STYLE_MASK) == PS_NULL) dwWidth = 1;