Commit 1510cfc4 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Allocate the correct size string in InternetCrackUrl.

parent cef19de8
......@@ -1024,11 +1024,13 @@ BOOL WINAPI InternetCrackUrlA(LPCSTR lpszUrl, DWORD dwUrlLength, DWORD dwFlags,
DWORD nLength;
URL_COMPONENTSW UCW;
WCHAR* lpwszUrl;
if(dwUrlLength==0)
dwUrlLength=strlen(lpszUrl);
lpwszUrl=HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*(dwUrlLength+1));
memset(lpwszUrl,0,sizeof(WCHAR)*(dwUrlLength+1));
nLength=MultiByteToWideChar(CP_ACP,0,lpszUrl,dwUrlLength,lpwszUrl,dwUrlLength+1);
if(dwUrlLength<=0)
dwUrlLength=-1;
nLength=MultiByteToWideChar(CP_ACP,0,lpszUrl,dwUrlLength,NULL,0);
lpwszUrl=HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WCHAR)*nLength);
MultiByteToWideChar(CP_ACP,0,lpszUrl,dwUrlLength,lpwszUrl,nLength);
memset(&UCW,0,sizeof(UCW));
if(lpUrlComponents->dwHostNameLength!=0)
UCW.dwHostNameLength=1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment