# HG changeset patch # User Maxim Dounin # Date 1377281919 -14400 # Node ID ee2a4c68fb35187906fbaed1331f1faa46ed1286 # Parent 010bb2e21f3f9c47469accbc503aed29d7dc5cae Fixed try_files with empty argument (ticket #390). diff -r 010bb2e21f3f -r ee2a4c68fb35 src/http/ngx_http_core_module.c --- a/src/http/ngx_http_core_module.c Fri Aug 23 16:24:24 2013 +0400 +++ b/src/http/ngx_http_core_module.c Fri Aug 23 22:18:39 2013 +0400 @@ -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';