diff src/http/ngx_http_core_module.c @ 672:f41d4b305d22 NGINX_1_2_0

nginx 1.2.0 *) Bugfix: a segmentation fault might occur in a worker process if the "try_files" directive was used; the bug had appeared in 1.1.19. *) Bugfix: response might be truncated if there were more than IOV_MAX buffers used. *) Bugfix: in the "crop" parameter of the "image_filter" directive. Thanks to Maxim Bublis.
author Igor Sysoev <http://sysoev.ru>
date Mon, 23 Apr 2012 00:00:00 +0400
parents ad45b044f1e5
children 4dcaf40cc702
line wrap: on
line diff
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -1240,7 +1240,7 @@ ngx_http_core_try_files_phase(ngx_http_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;