wininet: Check URLCache_LocalFileNameToPathW() return values in CreateUrlCacheEntryW().
It would be unfortunate if a long file name would cause us to open a file based on mostly uninitialized data and write the contents of some random webpage into it.
This commit is contained in:
parent
578df29b9f
commit
7782e81887
|
@ -2330,7 +2330,13 @@ BOOL WINAPI CreateUrlCacheEntryW(
|
|||
CacheDir = (BYTE)(rand() % pHeader->DirectoryCount);
|
||||
|
||||
lBufferSize = MAX_PATH * sizeof(WCHAR);
|
||||
URLCache_LocalFileNameToPathW(pContainer, pHeader, szFile, CacheDir, lpszFileName, &lBufferSize);
|
||||
if (!URLCache_LocalFileNameToPathW(pContainer, pHeader, szFile, CacheDir, lpszFileName, &lBufferSize))
|
||||
{
|
||||
WARN("Failed to get full path for filename %s, needed %u bytes.\n",
|
||||
debugstr_a(szFile), lBufferSize);
|
||||
URLCacheContainer_UnlockIndex(pContainer, pHeader);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
URLCacheContainer_UnlockIndex(pContainer, pHeader);
|
||||
|
||||
|
|
Loading…
Reference in New Issue