Welcome! Log In Create A New Profile

Advanced

[nginx] Fixed ngx_http_parse_chunked() minimal length calculation.

Maxim Dounin
June 28, 2013 06:24AM
details: http://hg.nginx.org/nginx/rev/b66ec10e901a
branches:
changeset: 5256:b66ec10e901a
user: Maxim Dounin <mdounin@mdounin.ru>
date: Fri Jun 28 13:55:05 2013 +0400
description:
Fixed ngx_http_parse_chunked() minimal length calculation.

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.

diffstat:

src/http/ngx_http_parse.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diffs (15 lines):

diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -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:

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Fixed ngx_http_parse_chunked() minimal length calculation.

Maxim Dounin 1067 June 28, 2013 06:24AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 110
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready