From 6cce5954f620e531987d8c2bd9b326793ed5bea1 Mon Sep 17 00:00:00 2001 From: yueshangzuo Date: Thu, 24 Jul 2025 14:56:56 +0800 Subject: [PATCH] HTTP: fix content type length check. Previously, the function checked content_type.len == 0 before allocating memory using content_type_len. This might cause a bug in some malformed requests when content_type_len may be 0. --- src/http/ngx_http_core_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index c75ddb849..3bdecce5d 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -1574,7 +1574,7 @@ ngx_http_test_content_type(ngx_http_request_t *r, ngx_hash_t *types_hash) return (void *) 4; } - if (r->headers_out.content_type.len == 0) { + if (r->headers_out.content_type_len == 0) { return NULL; }