diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-05-29 23:57:58 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-05-30 19:49:40 +0200 |
commit | 1c1d9f1affbd3367bcb24062e261d0ea5d185e3a (patch) | |
tree | cebd58fc62fe33c97b6f22d0f03b3d87a65e04ae /lib/hsts.c | |
parent | 9097843e8fe42aa237c3c2087cfde781fbb5b331 (diff) | |
download | curl-1c1d9f1affbd3367bcb24062e261d0ea5d185e3a.tar.gz |
hsts: ignore numberical IP address hosts
Also, use a single function library-wide for detecting if a given hostname is
a numerical IP address.
Reported-by: Harry Sintonen
Fixes #7146
Closes #7149
Diffstat (limited to 'lib/hsts.c')
-rw-r--r-- | lib/hsts.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/hsts.c b/lib/hsts.c index ef166f196..0d5a58401 100644 --- a/lib/hsts.c +++ b/lib/hsts.c @@ -138,6 +138,11 @@ CURLcode Curl_hsts_parse(struct hsts *h, const char *hostname, struct stsentry *sts; time_t now = time(NULL); + if(Curl_host_is_ipnum(hostname)) + /* "explicit IP address identification of all forms is excluded." + / RFC 6797 */ + return CURLE_OK; + do { while(*p && ISSPACE(*p)) p++; |