Resent: dlls/wininet/http.c: HTTP_HttpOpenRequestA

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Thu May 15 12:40:27 CDT 2003


       Changelog:
       dlls/wininet/http.c: HTTP_HttpOpenRequestA
       Calculate size from the same argument that is used later
       Check for possible NULL arguments

-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Index: wine/dlls/wininet/http.c
===================================================================
RCS file: /home/wine/wine/dlls/wininet/http.c,v
retrieving revision 1.34
diff -u -r1.34 http.c
--- wine/dlls/wininet/http.c	14 Apr 2003 21:32:36 -0000	1.34
+++ wine/dlls/wininet/http.c	5 May 2003 17:38:13 -0000
@@ -398,8 +398,18 @@
         sprintf(proxy, "http://%s/", hIC->lpszProxy);
         InternetCrackUrlA(proxy, 0, 0, &UrlComponents);
         if (strlen(UrlComponents.lpszHostName)) {
-			 /* for constant 13 see above */
-             char* url = HeapAlloc(GetProcessHeap(), 0, strlen(lpwhr->lpszHostName) + strlen(lpwhr->lpszPath) + 13);
+	     char* url;
+	     DWORD needed = 13;/* for constant 13 see above */
+	     
+	     if(lpwhs->lpszServerName)
+	       needed += strlen(lpwhs->lpszServerName);
+	     else
+	       TRACE("no lpwhs->lpszServerName\n");
+	     if(lpwhr->lpszPath)
+	       needed += strlen(lpwhr->lpszPath);
+	     else
+	       TRACE("no lpwhr->lpszPath\n");
+	     url= HeapAlloc(GetProcessHeap(), 0, needed);
 
              if(UrlComponents.nPort == INTERNET_INVALID_PORT_NUMBER)
                  UrlComponents.nPort = INTERNET_DEFAULT_HTTP_PORT;



More information about the wine-devel mailing list