Module: wine Branch: master Commit: d36f50c43841bb1e5abdc684724a6be355f94ade URL: https://gitlab.winehq.org/wine/wine/-/commit/d36f50c43841bb1e5abdc684724a6be...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Sat Dec 2 23:23:02 2023 +0800
wininet: Fix a use-after-free (Coverity).
pEntry could be freed after cache_container_unlock_index(pContainer, pHeader).
---
dlls/wininet/urlcache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wininet/urlcache.c b/dlls/wininet/urlcache.c index 8e43eaae9f3..7975071ce91 100644 --- a/dlls/wininet/urlcache.c +++ b/dlls/wininet/urlcache.c @@ -2550,8 +2550,8 @@ BOOL WINAPI UnlockUrlCacheEntryFileA(LPCSTR lpszUrlName, DWORD dwReserved) 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; }