diff options
author | Daniel Stenberg <daniel@haxx.se> | 2018-09-21 08:17:39 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-09-21 11:19:14 +0200 |
commit | 2097cd515289581df5dfb6eeb5942d083a871fa4 (patch) | |
tree | 9e84d0c8a018fbeebc499d87c41daa185c2f113d /lib | |
parent | 9bdadbbdee61c1726c2f5ee9452fd4cd6a933128 (diff) |
urlapi: fix support for address scope in IPv6 numerical addresses
Closes #3024
Diffstat (limited to 'lib')
-rw-r--r-- | lib/urlapi-int.h | 4 | ||||
-rw-r--r-- | lib/urlapi.c | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/urlapi-int.h b/lib/urlapi-int.h index 7ac09fdb5..a5bb8ea0b 100644 --- a/lib/urlapi-int.h +++ b/lib/urlapi-int.h @@ -22,6 +22,10 @@ * ***************************************************************************/ #include "curl_setup.h" +/* scheme is not URL encoded, the longest libcurl supported ones are 6 + letters */ +#define MAX_SCHEME_LEN 8 + bool Curl_is_absolute_url(const char *url, char *scheme, size_t buflen); char *Curl_concat_url(const char *base, const char *relurl); size_t Curl_strlen_url(const char *url, bool relative); diff --git a/lib/urlapi.c b/lib/urlapi.c index ef565d98d..ff58a69cc 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -53,10 +53,6 @@ struct Curl_URL { #define DEFAULT_SCHEME "https" -/* scheme is not URL encoded, the longest libcurl supported ones are 6 - letters */ -#define MAX_SCHEME_LEN 8 - static void free_urlhandle(struct Curl_URL *u) { free(u->scheme); @@ -480,7 +476,7 @@ static CURLUcode parse_port(struct Curl_URL *u, char *hostname) char endbracket; int len; - if((1 == sscanf(hostname, "[%*45[0123456789abcdefABCDEF:.]%c%n", + if((1 == sscanf(hostname, "[%*45[0123456789abcdefABCDEF:.%%]%c%n", &endbracket, &len)) && (']' == endbracket)) { /* this is a RFC2732-style specified IP-address */ @@ -561,7 +557,7 @@ static CURLUcode hostname_check(char *hostname, unsigned int flags) if(hostname[0] == '[') { hostname++; - l = "0123456789abcdefABCDEF::."; + l = "0123456789abcdefABCDEF::.%"; hlen -= 2; } |