Commit f70c9ae8 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wininet: Fixed handing NULL buffer in InternetReadFileExW.

parent cebb5d30
......@@ -2280,7 +2280,7 @@ BOOL WINAPI InternetReadFileExW(HINTERNET hFile, LPINTERNET_BUFFERSW lpBuffer,
TRACE("(%p %p 0x%x 0x%lx)\n", hFile, lpBuffer, dwFlags, dwContext);
if (lpBuffer->dwStructSize != sizeof(*lpBuffer)) {
if (!lpBuffer || lpBuffer->dwStructSize != sizeof(*lpBuffer)) {
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
......
......@@ -1067,6 +1067,11 @@ static void InternetReadFileExA_test(int flags)
CLEAR_NOTIFIED(INTERNET_STATUS_CONNECTING_TO_SERVER);
CLEAR_NOTIFIED(INTERNET_STATUS_CONNECTED_TO_SERVER);
rc = InternetReadFileExW(hor, NULL, 0, 0xdeadcafe);
ok(!rc && (GetLastError() == ERROR_INVALID_PARAMETER),
"InternetReadFileEx should have failed with ERROR_INVALID_PARAMETER instead of %s, %u\n",
rc ? "TRUE" : "FALSE", GetLastError());
/* tests invalid dwStructSize */
inetbuffers.dwStructSize = sizeof(inetbuffers)+1;
inetbuffers.lpcszHeader = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment