]> git.kaiwu.me - nginx.git/commitdiff
Fixed try_files with empty argument (ticket #390).
authorMaxim Dounin <mdounin@mdounin.ru>
Fri, 23 Aug 2013 18:18:39 +0000 (22:18 +0400)
committerMaxim Dounin <mdounin@mdounin.ru>
Fri, 23 Aug 2013 18:18:39 +0000 (22:18 +0400)
src/http/ngx_http_core_module.c

index 25d3dc97de375282fcb3487c158a31d2278503d0..f2c3adeff3b219c2a63fc410afa167ad7c7f208b 100644 (file)
@@ -4758,7 +4758,9 @@ ngx_http_core_try_files(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
 
         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';