details:   http://hg.nginx.org/nginx/rev/ddf740b9fdf6
branches:  stable-1.4
changeset: 5416:ddf740b9fdf6
user:      Maxim Dounin <[email protected]>
date:      Fri Aug 23 22:18:39 2013 +0400
description:
Fixed try_files with empty argument (ticket #390).

diffstat:

 src/http/ngx_http_core_module.c |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (14 lines):

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
@@ -4758,7 +4758,9 @@ ngx_http_core_try_files(ngx_conf_t *cf, 
 
         tf[i].name = value[i + 1];
 
-        if (tf[i].name.data[tf[i].name.len - 1] == '/') {
+        if (tf[i].name.len > 0
+            && tf[i].name.data[tf[i].name.len - 1] == '/')
+        {
             tf[i].test_dir = 1;
             tf[i].name.len--;
             tf[i].name.data[tf[i].name.len] = '\0';

_______________________________________________
nginx-devel mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx-devel

Reply via email to