From 61bcd1105a6ab7c089242c40e2660ffd9a3aa257 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 27 Feb 2026 07:59:10 +0100 Subject: [PATCH] cfilter: move a debug-only check into ifdef DEBUGBUILD Pointed out by CodeSonar Closes #20756 --- lib/cfilters.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/cfilters.c b/lib/cfilters.c index 4905418fa3..27b0306180 100644 --- a/lib/cfilters.c +++ b/lib/cfilters.c @@ -1089,13 +1089,14 @@ CURLcode Curl_conn_send(struct Curl_easy *data, int sockindex, const char *p = getenv("CURL_SMALLSENDS"); if(p) { curl_off_t altsize; - if(!curlx_str_number(&p, &altsize, write_len)) + if(!curlx_str_number(&p, &altsize, write_len)) { write_len = (size_t)altsize; + if(write_len != len) + eos = FALSE; + } } } #endif - if(write_len != len) - eos = FALSE; if(data && data->conn && data->conn->send[sockindex]) return data->conn->send[sockindex](data, sockindex, buf, write_len, eos, pnwritten);