diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 11651e5566b..332e4f79816 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -1989,6 +1989,11 @@ static BOOL INET_QueryOptionHelper(BOOL bIsUnicode, HINTERNET hInternet, DWORD d TRACE("(%p, 0x%08lx, %p, %p)\n", hInternet, dwOption, lpBuffer, lpdwBufferLength); lpwhh = (LPWININETHANDLEHEADER) WININET_GetObject( hInternet ); + if (!lpwhh) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } switch (dwOption) {