summaryrefslogtreecommitdiff
path: root/lib/hsts.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-05-29 23:57:58 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-05-30 19:49:40 +0200
commit1c1d9f1affbd3367bcb24062e261d0ea5d185e3a (patch)
treecebd58fc62fe33c97b6f22d0f03b3d87a65e04ae /lib/hsts.c
parent9097843e8fe42aa237c3c2087cfde781fbb5b331 (diff)
downloadcurl-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.c5
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++;