[WININET] Avoid crash
Sven Paschukat
Sven.Paschukat at t-online.de
Tue Mar 15 16:32:14 CST 2005
Native shlwapi.dll calls GetUrlCacheEntryInfoExW in wininet.dll with
params 2 - 6 set to null. This undocumented parameter setting later
results to a crash in URLCache_CopyEntry. Following code fixed it.
ChangeLog:
Avoid crash in URLCache_CopyEntry
-------------- next part --------------
Index: dlls/wininet/urlcache.c
===================================================================
RCS file: /home/wine/wine/dlls/wininet/urlcache.c,v
retrieving revision 1.24
diff -u -p -r1.24 urlcache.c
--- dlls/wininet/urlcache.c 8 Feb 2005 13:43:09 -0000 1.24
+++ dlls/wininet/urlcache.c 15 Mar 2005 21:43:05 -0000
@@ -1245,6 +1245,13 @@ BOOL WINAPI GetUrlCacheEntryInfoW(LPCWST
return FALSE;
}
+ /* There are undocumented calls with this params set to NULL */
+ if (lpCacheEntryInfo == NULL && lpdwCacheEntryInfoBufferSize == NULL)
+ {
+ URLCacheContainer_UnlockIndex(pContainer, pHeader);
+ return TRUE;
+ }
+
pUrlEntry = (URL_CACHEFILE_ENTRY *)pEntry;
TRACE("Found URL: %s\n", debugstr_a(pUrlEntry->szSourceUrlName));
TRACE("Header info: %s\n", debugstr_a((LPSTR)pUrlEntry + pUrlEntry->dwOffsetHeaderInfo));
More information about the wine-patches
mailing list