]> 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 <s.kandaurov@f5.com>
Thu, 6 Aug 2026 18:19:11 +0000 (22:19 +0400)
This was broken in f405ef11f (1.29.4).

Reported by Matt Suiche, Tolmo Inc.

src/http/ngx_http_parse.c

index e1328da049e66d82491a1df467df3a6c62e107b8..e547d0fdb8f450b4817cc8cb24005dd65061b570 100644 (file)
@@ -2420,7 +2420,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;
     }