From 108a61f8e7044b0d1b785e50cd9681db74c5b148 Mon Sep 17 00:00:00 2001 From: Misha Koshelev Date: Sun, 19 Aug 2007 01:52:22 -0500 Subject: [PATCH] shlwapi: Take sizeof(WCHAR) into account when allocating Unicode string. --- dlls/shlwapi/url.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c index 68d93093856..e1c0aa6cd48 100644 --- a/dlls/shlwapi/url.c +++ b/dlls/shlwapi/url.c @@ -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)))