wininet: Fix GetUrlCacheEntryInfoA/W when a NULL lpCacheEntryInfo parameter is passed in.
This commit is contained in:
parent
d929cdef97
commit
ab849ee297
|
@ -112,6 +112,11 @@ static void test_GetUrlCacheEntryInfoExA(void)
|
|||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -1536,6 +1536,9 @@ BOOL WINAPI GetUrlCacheEntryInfoA(
|
|||
|
||||
if (lpdwCacheEntryInfoBufferSize)
|
||||
{
|
||||
if (!lpCacheEntryInfo)
|
||||
*lpdwCacheEntryInfoBufferSize = 0;
|
||||
|
||||
error = URLCache_CopyEntry(
|
||||
pContainer,
|
||||
pHeader,
|
||||
|
@ -1614,6 +1617,9 @@ BOOL WINAPI GetUrlCacheEntryInfoW(LPCWSTR lpszUrl,
|
|||
|
||||
if (lpdwCacheEntryInfoBufferSize)
|
||||
{
|
||||
if (!lpCacheEntryInfo)
|
||||
*lpdwCacheEntryInfoBufferSize = 0;
|
||||
|
||||
error = URLCache_CopyEntry(
|
||||
pContainer,
|
||||
pHeader,
|
||||
|
|
Loading…
Reference in New Issue