From 133b125b89af0df9cd8ff91c182a57f5dcda16ab Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 12 Mar 2026 10:02:29 +0100 Subject: [PATCH] http: make Curl_compareheader handle multiple commas in header For robustness --- lib/http.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/http.c b/lib/http.c index a1253be680..73920cd748 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1449,7 +1449,11 @@ bool Curl_compareheader(const char *headerline, /* line to check */ if(curlx_str_until(&p, &next, MAX_HTTP_RESP_HEADER_SIZE, ',') || curlx_str_single(&p, ',')) break; /* no comma, get out */ - curlx_str_passblanks(&p); + + /* if there are more dummy commas, move over them as well */ + do + curlx_str_passblanks(&p); + while(!curlx_str_single(&p, ',')); len -= (p - o); } }