commit | 0f49681f28139fabeb0da90f98129532221d5b0d | [log] [tgz] |
---|---|---|
author | Maxim Dounin <mdounin@mdounin.ru> | Fri Aug 23 22:18:39 2013 +0400 |
committer | Maxim Dounin <mdounin@mdounin.ru> | Fri Aug 23 22:18:39 2013 +0400 |
tree | d965736ec69fa5d34c8a9060903ea70db61c3b2b | |
parent | a01f0078edfecc6ef3d406bb4b3100737f592d4c [diff] |
Fixed try_files with empty argument (ticket #390).
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index 47e5ff7..85b4fe8 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c
@@ -4766,7 +4766,9 @@ 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';