aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c4
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 36f00f61e..7a2960830 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -4489,7 +4489,9 @@ ngx_http_core_root(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
clcf->alias = alias ? clcf->name.len : 0;
clcf->root = value[1];
- if (!alias && clcf->root.data[clcf->root.len - 1] == '/') {
+ if (!alias && clcf->root.len > 0
+ && clcf->root.data[clcf->root.len - 1] == '/')
+ {
clcf->root.len--;
}