From 0aebee9825ef66bf2a8b0a94fd8abbae45fbfe53 Mon Sep 17 00:00:00 2001 From: Huw D M Davies Date: Sun, 21 Jan 2001 21:09:00 +0000 Subject: [PATCH] Escape any spaces in lpszObjectName passed to HttpOpenRequest. --- dlls/wininet/http.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 784912a6233..a3bac3ada2c 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -15,6 +15,7 @@ #include "debugtools.h" #include "winerror.h" #include "winsock.h" +#include "shlwapi.h" #include #ifdef HAVE_SYS_SOCKET_H @@ -222,8 +223,13 @@ INTERNETAPI HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession, lpwhr->hdr.dwContext = dwContext; lpwhr->nSocketFD = INVALID_SOCKET; - if (NULL != lpszObjectName && strlen(lpszObjectName)) - lpwhr->lpszPath = HTTP_strdup(lpszObjectName); + if (NULL != lpszObjectName && strlen(lpszObjectName)) { + DWORD needed = 0; + UrlEscapeA(lpszObjectName, NULL, &needed, URL_ESCAPE_SPACES_ONLY); + lpwhr->lpszPath = HeapAlloc(GetProcessHeap(), 0, needed); + UrlEscapeA(lpszObjectName, lpwhr->lpszPath, &needed, + URL_ESCAPE_SPACES_ONLY); + } if (NULL != lpszReferrer && strlen(lpszReferrer)) HTTP_ProcessHeader(lpwhr, HTTP_REFERER, lpszReferrer, HTTP_ADDHDR_FLAG_COALESCE); -- 2.11.4.GIT