diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c index 096a561c4..9d502acf5 100644 --- a/src/http/ngx_http_core_module.c +++ b/src/http/ngx_http_core_module.c @@ -1272,7 +1272,9 @@ ngx_http_core_try_files_phase(ngx_http_request_t *r, *e.pos = '\0'; - if (alias && ngx_strncmp(name, clcf->name.data, alias) == 0) { + if (alias && alias != NGX_MAX_SIZE_T_VALUE + && ngx_strncmp(name, clcf->name.data, alias) == 0) + { ngx_memmove(name, name + alias, len - alias); path.len -= alias; }