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

Alexandre Julliard julliard at wine.codeweavers.com
Mon Aug 20 07:42:40 CDT 2007


Module: wine
Branch: master
Commit: 108a61f8e7044b0d1b785e50cd9681db74c5b148
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=108a61f8e7044b0d1b785e50cd9681db74c5b148

Author: Misha Koshelev <mk144210 at bcm.edu>
Date:   Sun Aug 19 01:52:22 2007 -0500

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

---

 dlls/shlwapi/url.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c
index 68d9309..e1c0aa6 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)))




More information about the wine-cvs mailing list