# HG changeset patch # User Igor Sysoev # Date 1237378879 0 # Node ID 9c42c19f364a018bbea4bed259f171e041212f7c # Parent 5c8d9e3cbd8a0d5631460f22a10956f62c5d9a71 reserve space for r->uri, the bug has been introduced in r2566 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 @@ -1688,7 +1688,9 @@ ngx_http_map_uri_to_path(ngx_http_reques last = ngx_copy(path->data, clcf->root.data, clcf->root.len); } else { - if (ngx_http_script_run(r, path, clcf->root_lengths->elts, ++reserved, + reserved += alias ? 1 : r->uri.len + 1; + + if (ngx_http_script_run(r, path, clcf->root_lengths->elts, reserved, clcf->root_values->elts) == NULL) {