From a083613d8405fa3ad7f6bc5bbbb635d0f50799e0 Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Tue, 14 Apr 2026 19:39:50 +0200 Subject: [PATCH] Fixed checking headers longer than actually needed The prevents matching header like "Content-Length-Anything:" as "Content-Length:" header. --- src/microhttpd/connection.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c index 4db9fae6..7593cb27 100644 --- a/src/microhttpd/connection.c +++ b/src/microhttpd/connection.c @@ -4902,10 +4902,9 @@ parse_connection_headers (struct MHD_Connection *connection) for (pos = connection->rq.headers_received; NULL != pos; pos = pos->next) if ( (0 != (pos->kind & MHD_HEADER_KIND)) && - (MHD_str_equal_caseless_bin_n_ (MHD_HTTP_HEADER_CONTENT_LENGTH, - pos->header, - MHD_STATICSTR_LEN_ ( - MHD_HTTP_HEADER_CONTENT_LENGTH))) ) + (MHD_str_equal_caseless_s_bin_n_ (MHD_HTTP_HEADER_CONTENT_LENGTH, + pos->header, + pos->header_size)) ) { const char *clen; size_t val_len;