# HG changeset patch # User Maxim Dounin # Date 1377281919 -14400 # Node ID ee2a4c68fb35187906fbaed1331f1faa46ed1286 # Parent 010bb2e21f3f9c47469accbc503aed29d7dc5cae 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 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -4766,7 +4766,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';