]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http: make Curl_compareheader handle multiple commas in header
authorDaniel Stenberg <daniel@haxx.se>
Thu, 12 Mar 2026 09:02:29 +0000 (10:02 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 12 Mar 2026 09:30:18 +0000 (10:30 +0100)
For robustness

lib/http.c

index a1253be6802844a0fb908b0df5c552e72ad1fbaa..73920cd7488bdc35ead18b050f4d1d6c126bd9ac 100644 (file)
@@ -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);
     }
   }