mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
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.
This commit is contained in:
parent
dec513d6e4
commit
b0de3d7013
@ -1353,6 +1353,7 @@ ngx_http_core_try_files_phase(ngx_http_request_t *r,
|
|||||||
r->uri.len = alias + path.len;
|
r->uri.len = alias + path.len;
|
||||||
r->uri.data = ngx_pnalloc(r->pool, r->uri.len);
|
r->uri.data = ngx_pnalloc(r->pool, r->uri.len);
|
||||||
if (r->uri.data == NULL) {
|
if (r->uri.data == NULL) {
|
||||||
|
r->uri.len = 0;
|
||||||
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
||||||
return NGX_OK;
|
return NGX_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user