summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-03-03 14:12:35 +0100
committerDaniel Stenberg <daniel@haxx.se>2018-03-04 19:50:48 +0100
commitb7f90470be9b75f57167abbcd63aadb2e3b33958 (patch)
treecd53f189614e8bd84e483c4c1e3e73133a7602ec /lib
parent8b0b1a30881590e70082784e16f3c2c66d88b218 (diff)
downloadcurl-b7f90470be9b75f57167abbcd63aadb2e3b33958.tar.gz
NO_PROXY: fix for IPv6 numericals in the URL
Added test 1265 that verifies. Reported-by: steelman on github Fixes #2353 Closes #2355
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/url.c b/lib/url.c
index f991ade5c..945d4e327 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -2574,7 +2574,15 @@ static bool check_noproxy(const char *name, const char *no_proxy)
/* NO_PROXY was specified and it wasn't just an asterisk */
no_proxy_len = strlen(no_proxy);
- endptr = strchr(name, ':');
+ if(name[0] == '[') {
+ /* IPv6 numerical address */
+ endptr = strchr(name, ']');
+ if(!endptr)
+ return FALSE;
+ name++;
+ }
+ else
+ endptr = strchr(name, ':');
if(endptr)
namelen = endptr - name;
else