From 213bfd27776ac453689e3bd4864f6077c3169faa Mon Sep 17 00:00:00 2001 From: Misha Koshelev Date: Thu, 12 Jul 2007 00:38:20 -0500 Subject: [PATCH] urlmon: Fix HttpProtocol_Start and strndupW to work properly with native wininet. --- dlls/urlmon/http.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c index c501f059baa..ff793340515 100644 --- a/dlls/urlmon/http.c +++ b/dlls/urlmon/http.c @@ -190,8 +190,9 @@ static void CALLBACK HTTPPROTOCOL_InternetStatusCallback( static inline LPWSTR strndupW(LPWSTR string, int len) { - LPWSTR ret = HeapAlloc(GetProcessHeap(), 0, (len+1)*sizeof(WCHAR)); - if (ret) + LPWSTR ret = NULL; + if (string && + (ret = HeapAlloc(GetProcessHeap(), 0, (len+1)*sizeof(WCHAR))) != NULL) { memcpy(ret, string, len*sizeof(WCHAR)); ret[len] = 0; @@ -304,7 +305,7 @@ static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl url.dwStructSize = sizeof(url); url.dwSchemeLength = url.dwHostNameLength = url.dwUrlPathLength = url.dwUserNameLength = url.dwPasswordLength = 1; - if (!InternetCrackUrlW(szUrl, 0, ICU_ESCAPE, &url)) + if (!InternetCrackUrlW(szUrl, 0, 0, &url)) { hres = MK_E_SYNTAX; goto done;