diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index ad999885c3d..8e4d714b223 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -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);