Commit ab849ee2 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

wininet: Fix GetUrlCacheEntryInfoA/W when a NULL lpCacheEntryInfo parameter is passed in.

parent d929cdef
...@@ -112,6 +112,11 @@ static void test_GetUrlCacheEntryInfoExA(void) ...@@ -112,6 +112,11 @@ static void test_GetUrlCacheEntryInfoExA(void)
check_cache_entry_infoA("GetUrlCacheEntryInfoEx", lpCacheEntryInfo); check_cache_entry_infoA("GetUrlCacheEntryInfoEx", lpCacheEntryInfo);
cbCacheEntryInfo = 100000;
ret = GetUrlCacheEntryInfoEx(TEST_URL, NULL, &cbCacheEntryInfo, NULL, NULL, NULL, 0);
ok(!ret, "GetUrlCacheEntryInfoEx with zero-length buffer should fail\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "GetUrlCacheEntryInfoEx should have set last error to ERROR_INSUFFICIENT_BUFFER instead of %d\n", GetLastError());
HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo); HeapFree(GetProcessHeap(), 0, lpCacheEntryInfo);
} }
......
...@@ -1536,6 +1536,9 @@ BOOL WINAPI GetUrlCacheEntryInfoA( ...@@ -1536,6 +1536,9 @@ BOOL WINAPI GetUrlCacheEntryInfoA(
if (lpdwCacheEntryInfoBufferSize) if (lpdwCacheEntryInfoBufferSize)
{ {
if (!lpCacheEntryInfo)
*lpdwCacheEntryInfoBufferSize = 0;
error = URLCache_CopyEntry( error = URLCache_CopyEntry(
pContainer, pContainer,
pHeader, pHeader,
...@@ -1614,6 +1617,9 @@ BOOL WINAPI GetUrlCacheEntryInfoW(LPCWSTR lpszUrl, ...@@ -1614,6 +1617,9 @@ BOOL WINAPI GetUrlCacheEntryInfoW(LPCWSTR lpszUrl,
if (lpdwCacheEntryInfoBufferSize) if (lpdwCacheEntryInfoBufferSize)
{ {
if (!lpCacheEntryInfo)
*lpdwCacheEntryInfoBufferSize = 0;
error = URLCache_CopyEntry( error = URLCache_CopyEntry(
pContainer, pContainer,
pHeader, pHeader,
......
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