]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
hostip: fix infof() output for non-ipv6 builds using IPv6 address
authorDaniel Stenberg <daniel@haxx.se>
Tue, 21 Oct 2025 21:43:30 +0000 (23:43 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 22 Oct 2025 06:41:19 +0000 (08:41 +0200)
Pointed out by ZeroPath

Closes #19184

lib/hostip.c

index 055ea78b483c4e205ed29ce468bfd99f9e6cac78..d4b1b87e7ad54c5bb6c683646618326fdb2fa788 100644 (file)
@@ -1352,9 +1352,9 @@ CURLcode Curl_loadhostpairs(struct Curl_easy *data)
           }
         }
 #ifndef USE_IPV6
-        if(memchr(target.str, ':', target.len)) {
-          infof(data, "Ignoring resolve address '%s', missing IPv6 support.",
-                address);
+        if(memchr(curlx_str(&target), ':', curlx_strlen(&target))) {
+          infof(data, "Ignoring resolve address '%.*s', missing IPv6 support.",
+                (int)curlx_strlen(&target), curlx_str(&target));
           if(curlx_str_single(&host, ','))
             goto err;
           continue;