From b7f90470be9b75f57167abbcd63aadb2e3b33958 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 3 Mar 2018 14:12:35 +0100 Subject: NO_PROXY: fix for IPv6 numericals in the URL Added test 1265 that verifies. Reported-by: steelman on github Fixes #2353 Closes #2355 --- lib/url.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'lib/url.c') 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 -- cgit v1.2.3