diff options
| author | Maxim Dounin <mdounin@mdounin.ru> | 2013-08-23 22:18:39 +0400 |
|---|---|---|
| committer | Maxim Dounin <mdounin@mdounin.ru> | 2013-08-23 22:18:39 +0400 |
| commit | b5656b31f14dd1dd126e9ae10fd8d0b932904388 (patch) | |
| tree | eeaa6138f1ff281501cc5c8d739aac141d462700 /src | |
| parent | 6db33c712b72e313e928374bfd6b471911b3e658 (diff) | |
| download | nginx-b5656b31f14dd1dd126e9ae10fd8d0b932904388.tar.gz nginx-b5656b31f14dd1dd126e9ae10fd8d0b932904388.tar.bz2 | |
Fixed try_files with empty argument (ticket #390).
Diffstat (limited to 'src')
| -rw-r--r-- | src/http/ngx_http_core_module.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index 25d3dc97d..f2c3adeff 100644 --- 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, 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'; |
