# HG changeset patch # User Sergey Kandaurov # Date 1496850395 -10800 # Node ID 6d0e0d982ec0a4444d75dbc93d09fbe987b860f8 # Parent e699e6b6d76c3eec4bd98e47f8324f194b847c9a 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. diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c --- 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_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; }