]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
https-connect, fix httpsrr target check
authorStefan Eissing <stefan@eissing.org>
Fri, 4 Apr 2025 16:10:28 +0000 (18:10 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 4 Apr 2025 19:31:02 +0000 (21:31 +0200)
The HTTPSRR check on the record's target was not working as it used the
wrong index on the NUL byte if the target was not NULL.

Fixes #16966
Reported-by: Pavel Kropachev
Closes #16968

lib/cf-https-connect.c

index 7b14a01abe0f78a9f6038b60507fe33031455bcc..9b80d9003c73029bb94f97a3db5312472f25adc5 100644 (file)
@@ -673,7 +673,7 @@ CURLcode Curl_cf_https_setup(struct Curl_easy *data,
        (!conn->dns_entry->hinfo->target ||      /* for same host */
         !conn->dns_entry->hinfo->target[0] ||
         (conn->dns_entry->hinfo->target[0] == '.' &&
-         !conn->dns_entry->hinfo->target[0])) &&
+         !conn->dns_entry->hinfo->target[1])) &&
        (conn->dns_entry->hinfo->port < 0 ||    /* for same port */
         conn->dns_entry->hinfo->port == conn->remote_port)) {
       size_t i;