]> git.kaiwu.me - nginx.git/commitdiff
Fixed overflow detection in chunked parser
authorSergey Kandaurov <pluknet@nginx.com>
Thu, 6 Aug 2026 17:14:27 +0000 (21:14 +0400)
committerSergey Kandaurov <pluknet@nginx.com>
Fri, 2 Oct 2026 14:33:28 +0000 (18:33 +0400)
This was broken in f405ef11f (1.29.4).

Reported by Matt Suiche, Tolmo Inc.

src/http/ngx_http_parse.c

index 81f689e5bdd5bcddb52c336049f68ed9039a580f..ceb138079c7d6b3b3009b2dd3b46fdd78930a5bc 100644 (file)
@@ -2404,7 +2404,7 @@ data:
     ctx->state = state;
     b->pos = pos;
 
-    if (ctx->size > NGX_MAX_OFF_T_VALUE - 5) {
+    if (ctx->size > NGX_MAX_OFF_T_VALUE - 9) {
         goto invalid;
     }