]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
socks: check for DNS entries with the right port number
authorDaniel Stenberg <daniel@haxx.se>
Thu, 26 Nov 2020 16:28:39 +0000 (17:28 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 26 Nov 2020 21:29:34 +0000 (22:29 +0100)
The resolve call is done with the right port number, but the subsequent
check used the wrong one, which then could find a previous resolve which
would return and leave the fresh resolve "incomplete" and leaking
memory.

Fixes #6247
Closes #6253

lib/socks.c

index d9f67ec5774019719ce4435141ae2d02798815b3..a2d1e621f9059fcde51df493c89493bed2a4e2b9 100644 (file)
@@ -771,7 +771,7 @@ CURLproxycode Curl_SOCKS5(const char *proxy_user,
 
   case CONNECT_RESOLVING:
     /* check if we have the name resolved by now */
-    dns = Curl_fetch_addr(conn, hostname, (int)conn->port);
+    dns = Curl_fetch_addr(conn, hostname, remote_port);
 
     if(dns) {
 #ifdef CURLRES_ASYNCH