# HG changeset patch # User Maxim Dounin # Date 1377281919 -14400 # Node ID ddf740b9fdf69942e9587749bc29916f7268ee57 # Parent f7e8e6bd537907c932a804d3a20ee1cee5acad89 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 @@ -4758,7 +4758,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';