Commit 1ea7666c authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

wininet: Don't crash in GetUrlCacheEntryInfoA/W if lpdwCacheEntryInfoBufferSize is NULL.

parent bad1e17e
...@@ -1526,18 +1526,21 @@ BOOL WINAPI GetUrlCacheEntryInfoA( ...@@ -1526,18 +1526,21 @@ BOOL WINAPI GetUrlCacheEntryInfoA(
if (pUrlEntry->dwOffsetHeaderInfo) if (pUrlEntry->dwOffsetHeaderInfo)
TRACE("Header info: %s\n", debugstr_a((LPSTR)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo)); TRACE("Header info: %s\n", debugstr_a((LPSTR)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo));
if (!URLCache_CopyEntry( if (lpdwCacheEntryInfoBufferSize)
pContainer, {
pHeader, if (!URLCache_CopyEntry(
lpCacheEntryInfo, pContainer,
lpdwCacheEntryInfoBufferSize, pHeader,
pUrlEntry, lpCacheEntryInfo,
FALSE /* ANSI */)) lpdwCacheEntryInfoBufferSize,
{ pUrlEntry,
URLCacheContainer_UnlockIndex(pContainer, pHeader); FALSE /* ANSI */))
return FALSE; {
URLCacheContainer_UnlockIndex(pContainer, pHeader);
return FALSE;
}
TRACE("Local File Name: %s\n", debugstr_a(lpCacheEntryInfo->lpszLocalFileName));
} }
TRACE("Local File Name: %s\n", debugstr_a(lpCacheEntryInfo->lpszLocalFileName));
URLCacheContainer_UnlockIndex(pContainer, pHeader); URLCacheContainer_UnlockIndex(pContainer, pHeader);
...@@ -1590,18 +1593,21 @@ BOOL WINAPI GetUrlCacheEntryInfoW(LPCWSTR lpszUrl, ...@@ -1590,18 +1593,21 @@ BOOL WINAPI GetUrlCacheEntryInfoW(LPCWSTR lpszUrl,
TRACE("Found URL: %s\n", debugstr_a((LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl)); TRACE("Found URL: %s\n", debugstr_a((LPSTR)pUrlEntry + pUrlEntry->dwOffsetUrl));
TRACE("Header info: %s\n", debugstr_a((LPSTR)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo)); TRACE("Header info: %s\n", debugstr_a((LPSTR)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo));
if (!URLCache_CopyEntry( if (lpdwCacheEntryInfoBufferSize)
pContainer,
pHeader,
(LPINTERNET_CACHE_ENTRY_INFOA)lpCacheEntryInfo,
lpdwCacheEntryInfoBufferSize,
pUrlEntry,
TRUE /* UNICODE */))
{ {
URLCacheContainer_UnlockIndex(pContainer, pHeader); if (!URLCache_CopyEntry(
return FALSE; pContainer,
pHeader,
(LPINTERNET_CACHE_ENTRY_INFOA)lpCacheEntryInfo,
lpdwCacheEntryInfoBufferSize,
pUrlEntry,
TRUE /* UNICODE */))
{
URLCacheContainer_UnlockIndex(pContainer, pHeader);
return FALSE;
}
TRACE("Local File Name: %s\n", debugstr_w(lpCacheEntryInfo->lpszLocalFileName));
} }
TRACE("Local File Name: %s\n", debugstr_w(lpCacheEntryInfo->lpszLocalFileName));
URLCacheContainer_UnlockIndex(pContainer, pHeader); URLCacheContainer_UnlockIndex(pContainer, 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