winspool.drv: Check ptr for being NULL (Coverity).

This commit is contained in:
Marcus Meissner 2009-12-03 10:18:19 +01:00 committed by Alexandre Julliard
parent 6a19339207
commit faf1485e4e
1 changed files with 1 additions and 1 deletions

View File

@ -3337,7 +3337,7 @@ static BOOL WINSPOOL_GetDevModeFromReg(HKEY hkey, LPCWSTR ValueName,
if (ptr && ((DEVMODEA*)ptr)->dmSize < sizeof(DEVMODEA))
((DEVMODEA*)ptr)->dmSize = sizeof(DEVMODEA);
sz += (CCHDEVICENAME + CCHFORMNAME);
if(buflen >= sz) {
if (ptr && (buflen >= sz)) {
DEVMODEW *dmW = GdiConvertToDevmodeW((DEVMODEA*)ptr);
memcpy(ptr, dmW, sz);
HeapFree(GetProcessHeap(),0,dmW);