diff options
author | Daniel Stenberg <daniel@haxx.se> | 2018-11-02 15:11:16 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-11-03 00:14:04 +0100 |
commit | b28094833a971870fd8c07960b3b12bf6fbbaad3 (patch) | |
tree | 3657786565944146e9db42bbe2e98c792e059b6f /lib | |
parent | 6987e3730e3745678616f493301252e5b2513dcb (diff) | |
download | curl-b28094833a971870fd8c07960b3b12bf6fbbaad3.tar.gz |
URL: fix IPv6 numeral address parser
Regression from 46e164069d1a52. Extended test 1560 to verify.
Reported-by: tpaukrt on github
Fixes #3218
Closes #3219
Diffstat (limited to 'lib')
-rw-r--r-- | lib/urlapi.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/urlapi.c b/lib/urlapi.c index c53e52343..18a6076ff 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -499,8 +499,12 @@ static CURLUcode parse_port(struct Curl_URL *u, char *hostname) (']' == endbracket)) { /* this is a RFC2732-style specified IP-address */ portptr = &hostname[len]; - if (*portptr != ':') - return CURLUE_MALFORMED_INPUT; + if(*portptr) { + if(*portptr != ':') + return CURLUE_MALFORMED_INPUT; + } + else + portptr = NULL; } else portptr = strchr(hostname, ':'); |