diff options
author | Sergey Kandaurov <pluknet@nginx.com> | 2017-06-07 18:46:35 +0300 |
---|---|---|
committer | Sergey Kandaurov <pluknet@nginx.com> | 2017-06-07 18:46:35 +0300 |
commit | b0de3d70130658436afba69d07d68712834deccb (patch) | |
tree | b6329d63fc0f015698a9af6e0788e09dd548f75c | |
parent | dec513d6e47aa883e2dbeaeb70c122e37b9abe70 (diff) | |
download | nginx-b0de3d70130658436afba69d07d68712834deccb.tar.gz |
Fixed segfault in try_files with nested location.
If memory allocation of a new r->uri.data storage failed, reset its length as
well. Request URI is used in ngx_http_finalize_request() for debug logging.
-rw-r--r-- | src/http/ngx_http_core_module.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index 7e40e7860..b5be1ffeb 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -1353,6 +1353,7 @@ ngx_http_core_try_files_phase(ngx_http_request_t *r, r->uri.len = alias + path.len; r->uri.data = ngx_pnalloc(r->pool, r->uri.len); if (r->uri.data == NULL) { + r->uri.len = 0; ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); return NGX_OK; } |