Fixed try_files with empty argument (ticket #390).

This commit is contained in:
Maxim Dounin 2013-08-23 22:18:39 +04:00
parent bbbe730163
commit c7f3d6d3d6
1 changed files with 3 additions and 1 deletions

View 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';