mirror of
https://github.com/nginx/nginx.git
synced 2026-08-04 14:58:20 +00:00
Fixed segfault with try_files (ticket #152).
The problem occured if first uri in try_files was shorter than request uri, resulting in reserve being 0 and hence allocation skipped. The bug was introduced in r4584 (1.1.19).
This commit is contained in:
parent
a73ce28e0a
commit
e8fe3ce098
1 changed files with 1 additions and 1 deletions
|
|
@ -1240,7 +1240,7 @@ ngx_http_core_try_files_phase(ngx_http_request_t *r,
|
|||
reserve = len > r->uri.len - alias ? len - (r->uri.len - alias) : 0;
|
||||
}
|
||||
|
||||
if (reserve > allocated) {
|
||||
if (reserve > allocated || !allocated) {
|
||||
|
||||
/* 16 bytes are preallocation */
|
||||
allocated = reserve + 16;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue