]> git.kaiwu.me - nginx.git/commitdiff
reserve space for r->uri, the bug has been introduced in r2566
authorIgor Sysoev <igor@sysoev.ru>
Wed, 18 Mar 2009 12:21:19 +0000 (12:21 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Wed, 18 Mar 2009 12:21:19 +0000 (12:21 +0000)
src/http/ngx_http_core_module.c

index 66698d5259922bb9dbd5d5553670bc2b0df0096d..66b3cee16f5ba0538a35b75967038950ec4077a2 100644 (file)
@@ -1688,7 +1688,9 @@ ngx_http_map_uri_to_path(ngx_http_request_t *r, ngx_str_t *path,
         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)
         {