Fixed Unicode buffer size bug in CreateUrlCacheEntryW.

This commit is contained in:
Alexandre Julliard 2005-11-15 16:56:04 +00:00
parent d78dce709e
commit 3566fe60a8
1 changed files with 2 additions and 2 deletions

View File

@ -1949,12 +1949,12 @@ BOOL WINAPI CreateUrlCacheEntryW(
CacheDir = (BYTE)(rand() % pHeader->DirectoryCount); CacheDir = (BYTE)(rand() % pHeader->DirectoryCount);
lBufferSize = MAX_PATH * sizeof(CHAR); lBufferSize = MAX_PATH * sizeof(WCHAR);
URLCache_LocalFileNameToPathW(pContainer, pHeader, szFile, CacheDir, lpszFileName, &lBufferSize); URLCache_LocalFileNameToPathW(pContainer, pHeader, szFile, CacheDir, lpszFileName, &lBufferSize);
URLCacheContainer_UnlockIndex(pContainer, pHeader); URLCacheContainer_UnlockIndex(pContainer, pHeader);
for (lpszFileNameNoPath = lpszFileName + lBufferSize / sizeof(CHAR) - 2; for (lpszFileNameNoPath = lpszFileName + lBufferSize / sizeof(WCHAR) - 2;
lpszFileNameNoPath >= lpszFileName; lpszFileNameNoPath >= lpszFileName;
--lpszFileNameNoPath) --lpszFileNameNoPath)
{ {