vtls: check final cfilter node in find_ssl_filter

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
This commit is contained in:
Joshua Rogers 2025-10-25 03:49:58 +08:00 committed by Daniel Stenberg
parent 8616e5aada
commit 0d5e24281d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View 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");