Mercurial > hg > nginx
changeset 6890:16487f9e6665 stable-1.10
HTTP/2: fixed saving preread buffer to temp file (ticket #1143).
Previously, a request body bigger than "client_body_buffer_size" wasn't written
into a temporary file if it has been pre-read entirely. The preread buffer
is freed after processing, thus subsequent use of it might result in sending
corrupted body or cause a segfault.
author | Valentin Bartenev <vbart@nginx.com> |
---|---|
date | Mon, 28 Nov 2016 19:19:21 +0300 |
parents | 09cf90250844 |
children | 749bcfdf097a |
files | src/http/v2/ngx_http_v2.c |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/http/v2/ngx_http_v2.c Thu Oct 20 16:15:03 2016 +0300 +++ b/src/http/v2/ngx_http_v2.c Mon Nov 28 19:19:21 2016 +0300 @@ -3560,6 +3560,9 @@ rb->buf = ngx_create_temp_buf(r->pool, (size_t) len); } else { + /* enforce writing body to file */ + r->request_body_in_file_only = 1; + rb->buf = ngx_calloc_buf(r->pool); if (rb->buf != NULL) {