Marcus Meissner : wininet: Check return value of InternetCrackUrl when checking referrer host.

Alexandre Julliard julliard at winehq.org
Thu Jan 3 06:43:46 CST 2008


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

Author: Marcus Meissner <marcus at jet.franken.de>
Date:   Tue Jan  1 23:20:37 2008 +0100

wininet: Check return value of InternetCrackUrl when checking referrer host.

---

 dlls/wininet/http.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 6845883..098d7d2 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -1441,13 +1441,14 @@ HINTERNET WINAPI HTTP_HttpOpenRequestW(LPWININETHTTPSESSIONW lpwhs,
         WCHAR buf[MAXHOSTNAME];
         URL_COMPONENTSW UrlComponents;
 
+        buf[0] = '\0';
         memset( &UrlComponents, 0, sizeof UrlComponents );
         UrlComponents.dwStructSize = sizeof UrlComponents;
         UrlComponents.lpszHostName = buf;
         UrlComponents.dwHostNameLength = MAXHOSTNAME;
 
-        InternetCrackUrlW(lpszReferrer, 0, 0, &UrlComponents);
-        if (strlenW(UrlComponents.lpszHostName))
+        if (InternetCrackUrlW(lpszReferrer, 0, 0, &UrlComponents) &&
+            strlenW(UrlComponents.lpszHostName))
             HTTP_ProcessHeader(lpwhr, szHost, UrlComponents.lpszHostName, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDREQ_FLAG_REPLACE | HTTP_ADDHDR_FLAG_REQ);
     }
     else




More information about the wine-cvs mailing list