[WINESYNC] wininet: Prevent use after free in logging.

Make logs which show values that are unmapped by cache_container_unlock_index()
go before it's called.

Signed-off-by: Jan Sikorski <jsikorski@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>

wine commit id bcdb58cc7959afd5fa35ab039e6564934888b4c0 by Jan Sikorski <jsikorski@codeweavers.com>
This commit is contained in:
winesync 2020-12-08 18:17:50 +01:00 committed by Jérôme Gardou
parent 8bf2b3cf2c
commit ef9a828ef8
2 changed files with 5 additions and 5 deletions

View File

@ -1841,9 +1841,9 @@ static BOOL urlcache_get_entry_info(const char *url, void *entry_info,
url_entry = (const entry_url*)((LPBYTE)header + hash_entry->offset);
if(url_entry->header.signature != URL_SIGNATURE) {
cache_container_unlock_index(container, header);
FIXME("Trying to retrieve entry of unknown format %s\n",
debugstr_an((LPCSTR)&url_entry->header.signature, sizeof(DWORD)));
cache_container_unlock_index(container, header);
SetLastError(ERROR_FILE_NOT_FOUND);
return FALSE;
}
@ -2074,8 +2074,8 @@ BOOL WINAPI SetUrlCacheEntryInfoA(LPCSTR lpszUrlName,
pEntry = (entry_header*)((LPBYTE)pHeader + pHashEntry->offset);
if (pEntry->signature != URL_SIGNATURE)
{
cache_container_unlock_index(pContainer, pHeader);
FIXME("Trying to retrieve entry of unknown format %s\n", debugstr_an((LPSTR)&pEntry->signature, sizeof(DWORD)));
cache_container_unlock_index(pContainer, pHeader);
SetLastError(ERROR_FILE_NOT_FOUND);
return FALSE;
}
@ -2144,9 +2144,9 @@ static BOOL urlcache_entry_get_file(const char *url, void *entry_info, DWORD *si
url_entry = (entry_url*)((LPBYTE)header + hash_entry->offset);
if(url_entry->header.signature != URL_SIGNATURE) {
cache_container_unlock_index(container, header);
FIXME("Trying to retrieve entry of unknown format %s\n",
debugstr_an((LPSTR)&url_entry->header.signature, sizeof(DWORD)));
cache_container_unlock_index(container, header);
SetLastError(ERROR_FILE_NOT_FOUND);
return FALSE;
}
@ -4037,9 +4037,9 @@ BOOL WINAPI IsUrlCacheEntryExpiredA(LPCSTR url, DWORD dwFlags, FILETIME* pftLast
pEntry = (const entry_header*)((LPBYTE)pHeader + pHashEntry->offset);
if (pEntry->signature != URL_SIGNATURE)
{
FIXME("Trying to retrieve entry of unknown format %s\n", debugstr_an((LPCSTR)&pEntry->signature, sizeof(DWORD)));
cache_container_unlock_index(pContainer, pHeader);
memset(pftLastModified, 0, sizeof(*pftLastModified));
FIXME("Trying to retrieve entry of unknown format %s\n", debugstr_an((LPCSTR)&pEntry->signature, sizeof(DWORD)));
return TRUE;
}

View File

@ -5,4 +5,4 @@ files:
include/wininet.h: sdk/include/psdk/wininet.h
include/winineti.h: sdk/include/psdk/winineti.h
tags:
wine: ef88a70fa775f3e7a26d8f1618f32ee94bb9ea05
wine: bcdb58cc7959afd5fa35ab039e6564934888b4c0