Juan Lang : wininet: Correct length of data passed to callback when resolving a name.

Alexandre Julliard julliard at winehq.org
Fri Dec 4 09:11:27 CST 2009


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Thu Dec  3 18:19:00 2009 -0800

wininet: Correct length of data passed to callback when resolving a name.

---

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

diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c
index bbef8ca..1d8a8f9 100644
--- a/dlls/wininet/ftp.c
+++ b/dlls/wininet/ftp.c
@@ -2535,7 +2535,7 @@ HINTERNET FTP_Connect(appinfo_t *hIC, LPCWSTR lpszServerName,
     }
         
     SendAsyncCallback(&hIC->hdr, dwContext, INTERNET_STATUS_RESOLVING_NAME,
-        (LPWSTR) lpszServerName, strlenW(lpszServerName));
+        (LPWSTR) lpszServerName, (strlenW(lpszServerName)+1) * sizeof(WCHAR));
 
     sock_namelen = sizeof(socketAddr);
     if (!GetAddress(lpszServerName, lpwfs->serverport, (struct sockaddr *)&socketAddr, &sock_namelen))
diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index 19a34cb..024d5d8 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -1389,7 +1389,7 @@ static DWORD HTTP_ResolveName(http_request_t *lpwhr)
     INTERNET_SendCallback(&lpwhr->hdr, lpwhr->hdr.dwContext,
                           INTERNET_STATUS_RESOLVING_NAME,
                           lpwhs->lpszServerName,
-                          strlenW(lpwhs->lpszServerName)+1);
+                          (strlenW(lpwhs->lpszServerName)+1) * sizeof(WCHAR));
 
     lpwhs->sa_len = sizeof(lpwhs->socketAddress);
     if (!GetAddress(lpwhs->lpszServerName, lpwhs->nServerPort,




More information about the wine-cvs mailing list