Mercurial > hg > nginx-quic
comparison src/http/ngx_http_request_body.c @ 5595:8a2261c59f3b stable-1.4
Request body: avoid potential overflow.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 03 Mar 2014 17:39:53 +0400 |
parents | 3b7463b08747 |
children |
comparison
equal
deleted
inserted
replaced
5594:c8a14fbd3ce9 | 5595:8a2261c59f3b |
---|---|
951 | 951 |
952 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); | 952 clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module); |
953 | 953 |
954 if (clcf->client_max_body_size | 954 if (clcf->client_max_body_size |
955 && clcf->client_max_body_size | 955 && clcf->client_max_body_size |
956 < r->headers_in.content_length_n + rb->chunked->size) | 956 - r->headers_in.content_length_n < rb->chunked->size) |
957 { | 957 { |
958 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, | 958 ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, |
959 "client intended to send too large chunked " | 959 "client intended to send too large chunked " |
960 "body: %O bytes", | 960 "body: %O+%O bytes", |
961 r->headers_in.content_length_n | 961 r->headers_in.content_length_n, |
962 + rb->chunked->size); | 962 rb->chunked->size); |
963 | 963 |
964 r->lingering_close = 1; | 964 r->lingering_close = 1; |
965 | 965 |
966 return NGX_HTTP_REQUEST_ENTITY_TOO_LARGE; | 966 return NGX_HTTP_REQUEST_ENTITY_TOO_LARGE; |
967 } | 967 } |