]> granicus.if.org Git - curl/commitdiff
- David McCreedy fixed a bad call to getsockname() that wrongly used a size_t
authorDaniel Stenberg <daniel@haxx.se>
Fri, 22 Dec 2006 13:30:54 +0000 (13:30 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 22 Dec 2006 13:30:54 +0000 (13:30 +0000)
  variable to point to when it should be a socklen_t.

CHANGES
lib/connect.c

diff --git a/CHANGES b/CHANGES
index 6f81cd2959b1bfa3da41a2dfd31c3d2b7f62dce6..ebab24763adc976b2caef6906804b9aa582af8c0 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -7,6 +7,9 @@
                                   Changelog
 
 Daniel (22 December 2006)
+- David McCreedy fixed a bad call to getsockname() that wrongly used a size_t
+  variable to point to when it should be a socklen_t.
+
 - When setting a proxy with environment variables and (for example) running
   'curl [URL]' with a URL without a protocol prefix, curl would not send a
   correct request as it failed to add the protocol prefix.
index 1ffb98b37b78465996ebcfc3b2b27bcc88dc2d11..2b38972040645abacc2149ab28074c80e446df97 100644 (file)
@@ -384,11 +384,10 @@ static CURLcode bindlocal(struct connectdata *conn,
     if( bind(sockfd, sock, socksize) >= 0) {
       /* we succeeded to bind */
       struct Curl_sockaddr_storage add;
-      size_t size;
+      socklen_t size;
 
       size = sizeof(add);
-      if(getsockname(sockfd, (struct sockaddr *) &add,
-                     (socklen_t *)&size)<0) {
+      if(getsockname(sockfd, (struct sockaddr *) &add, &size) < 0) {
         failf(data, "getsockname() failed");
         return CURLE_HTTP_PORT_FAILED;
       }