From: Daniel Stenberg Date: Thu, 23 Oct 2025 14:00:46 +0000 (+0200) Subject: schannel: replace a run-time condition with an assert X-Git-Tag: rc-8_17_0-3~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3692cd837e327bad414769a4af8a73efaeb864f2;p=thirdparty%2Fcurl.git schannel: replace a run-time condition with an assert For detecting a bad function argument that probably also would cause a compiler warning. Closes #19203 --- diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 9b2b1e702e..2e29ea2f18 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -1711,15 +1711,11 @@ schannel_recv_renegotiate(struct Curl_cfilter *cf, struct Curl_easy *data, failf(data, "schannel: unexpected call to schannel_recv_renegotiate"); return CURLE_SSL_CONNECT_ERROR; } - + DEBUGASSERT(caller <= SCH_RENEG_CALLER_IS_SEND); if(caller == SCH_RENEG_CALLER_IS_RECV) SCH_DEV(infof(data, "schannel: renegotiation caller is schannel_recv")); - else if(caller == SCH_RENEG_CALLER_IS_SEND) + else SCH_DEV(infof(data, "schannel: renegotiation caller is schannel_send")); - else { - failf(data, "schannel: unknown caller for schannel_recv_renegotiate"); - return CURLE_SSL_CONNECT_ERROR; - } sockfd = Curl_conn_cf_get_socket(cf, data);