diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-03-08 09:59:35 +0100 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-03-31 19:53:05 +0200 |
commit | 231837911980ff55a661e2509642442435082c90 (patch) | |
tree | 956c67a43f57b157c1b17ef9ca0a07d03a5e484d /crypto/http | |
parent | 80-test_cmp_http.t: Add diagnostic info on starting/stopping mock server (diff) | |
download | openssl-231837911980ff55a661e2509642442435082c90.tar.xz openssl-231837911980ff55a661e2509642442435082c90.zip |
OSSL_parse_url(): Improve handling of IPv6 addresses
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14630)
Diffstat (limited to 'crypto/http')
-rw-r--r-- | crypto/http/http_lib.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crypto/http/http_lib.c b/crypto/http/http_lib.c index 3bf642a4f4..f0fc770f22 100644 --- a/crypto/http/http_lib.c +++ b/crypto/http/http_lib.c @@ -87,11 +87,10 @@ int OSSL_parse_url(const char *url, char **pscheme, char **puser, char **phost, /* parse host name/address as far as needed here */ if (host[0] == '[') { /* ipv6 literal, which may include ':' */ - host++; - host_end = strchr(host, ']'); + host_end = strchr(host + 1, ']'); if (host_end == NULL) goto parse_err; - p = host_end + 1; + p = ++host_end; } else { /* look for start of optional port, path, query, or fragment */ host_end = strchr(host, ':'); |