Request body: avoid potential overflow.

This commit is contained in:
Maxim Dounin 2014-03-03 17:39:53 +04:00
parent d5da8fa776
commit 03fcee5d78

View File

@ -953,13 +953,13 @@ ngx_http_request_body_chunked_filter(ngx_http_request_t *r, ngx_chain_t *in)
if (clcf->client_max_body_size if (clcf->client_max_body_size
&& clcf->client_max_body_size && clcf->client_max_body_size
< r->headers_in.content_length_n + rb->chunked->size) - r->headers_in.content_length_n < rb->chunked->size)
{ {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"client intended to send too large chunked " "client intended to send too large chunked "
"body: %O bytes", "body: %O+%O bytes",
r->headers_in.content_length_n r->headers_in.content_length_n,
+ rb->chunked->size); rb->chunked->size);
r->lingering_close = 1; r->lingering_close = 1;