]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Dan F pointed out that we don't need to scan IPv6 addresses for '%'-letters
authorDaniel Stenberg <daniel@haxx.se>
Thu, 11 Dec 2008 23:27:22 +0000 (23:27 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 11 Dec 2008 23:27:22 +0000 (23:27 +0000)
in the parse_remote_port() function as the scope id has already been stripped
from the string.

lib/url.c

index 3e2b14e9d0f5f3347a2d359f4caf6d25eb0384be..0f25a9d3eea2b48c85486f305243438e8c94edf2 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -3724,7 +3724,10 @@ static CURLcode parse_remote_port(struct SessionHandle *data,
   char *portptr;
   char endbracket;
 
-  if((1 == sscanf(conn->host.name, "[%*45[0123456789abcdefABCDEF:.%]%c",
+  /* Note that at this point, the IPv6 address cannot contain any scope
+     suffix as that has already been removed in the ParseURLAndFillConnection()
+     function */
+  if((1 == sscanf(conn->host.name, "[%*45[0123456789abcdefABCDEF:.]%c",
                   &endbracket)) &&
      (']' == endbracket)) {
     /* this is a RFC2732-style specified IP-address */