]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
vtls: check final cfilter node in find_ssl_filter
authorJoshua Rogers <MegaManSec@users.noreply.github.com>
Fri, 24 Oct 2025 19:49:58 +0000 (03:49 +0800)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 3 Nov 2025 17:21:57 +0000 (18:21 +0100)
find_ssl_filter used while(cf && cf->next) and skipped the last node.
If the SSL filter was last, channel binding lookup failed and we returned
CURLE_BAD_FUNCTION_ARGUMENT. Switch to while(cf) so the tail is examined.

This bug was found with ZeroPath.

Closes #19229

lib/vtls/openssl.c

index f1c9e8bbd6334356071932f5c099380a29b535bc..764d8293255343a825b26d60515c7ef4f29e969b 100644 (file)
@@ -5684,10 +5684,8 @@ static CURLcode ossl_get_channel_binding(struct Curl_easy *data, int sockindex,
       break;
     }
 
-    if(cf->next)
-      cf = cf->next;
-
-  } while(cf->next);
+    cf = cf->next;
+  } while(cf);
 
   if(!octx) {
     failf(data, "Failed to find the SSL filter");