shlwapi: Take sizeof(WCHAR) into account when allocating Unicode string.

This commit is contained in:
Misha Koshelev 2007-08-19 01:52:22 -05:00 committed by Alexandre Julliard
parent ba026b1634
commit 108a61f8e7
1 changed files with 2 additions and 1 deletions

View File

@ -332,7 +332,8 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
}
nByteLen = (lstrlenW(pszUrl) + 1) * sizeof(WCHAR); /* length in bytes */
lpszUrlCpy = HeapAlloc(GetProcessHeap(), 0, INTERNET_MAX_URL_LENGTH);
lpszUrlCpy = HeapAlloc(GetProcessHeap(), 0,
INTERNET_MAX_URL_LENGTH * sizeof(WCHAR));
if((dwFlags & URL_FILE_USE_PATHURL) && nByteLen >= sizeof(wszFile)
&& !memcmp(wszFile, pszUrl, sizeof(wszFile)))