]> git.kaiwu.me - nginx.git/commitdiff
Fixed ngx_http_parse_chunked() minimal length calculation.
authorMaxim Dounin <mdounin@mdounin.ru>
Fri, 28 Jun 2013 09:55:05 +0000 (13:55 +0400)
committerMaxim Dounin <mdounin@mdounin.ru>
Fri, 28 Jun 2013 09:55:05 +0000 (13:55 +0400)
Minimal data length we expect for further calls was calculated incorrectly
if parsing stopped right after parsing chunk size.  This might in theory
affect clients and/or backends using LF instead of CRLF.

Patch by Dmitry Popov.

src/http/ngx_http_parse.c

index 87a22e0f8f76ccdd7869b5b72a36de79a02393d0..697d856a0192a79939bf5652c28e30b840c384c3 100644 (file)
@@ -2180,8 +2180,9 @@ data:
         ctx->length = 3 /* "0" LF LF */;
         break;
     case sw_chunk_size:
-        ctx->length = 2 /* LF LF */
-                      + (ctx->size ? ctx->size + 4 /* LF "0" LF LF */ : 0);
+        ctx->length = 1 /* LF */
+                      + (ctx->size ? ctx->size + 4 /* LF "0" LF LF */
+                                   : 1 /* LF */);
         break;
     case sw_chunk_extension:
     case sw_chunk_extension_almost_done: