mirror of
https://github.com/nginx/nginx.git
synced 2024-12-27 17:31:35 -06:00
test space between "~" and regex in server_name and invalid_referers
This commit is contained in:
parent
97aa4c86a1
commit
be9d165064
@ -506,6 +506,11 @@ ngx_http_add_regex_referer(ngx_conf_t *cf, ngx_http_referer_conf_t *rlcf,
|
|||||||
ngx_regex_elt_t *re;
|
ngx_regex_elt_t *re;
|
||||||
u_char errstr[NGX_MAX_CONF_ERRSTR];
|
u_char errstr[NGX_MAX_CONF_ERRSTR];
|
||||||
|
|
||||||
|
if (name->len == 1) {
|
||||||
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "empty regex in \"%V\"", name);
|
||||||
|
return NGX_CONF_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
if (rlcf->regex == NGX_CONF_UNSET_PTR) {
|
if (rlcf->regex == NGX_CONF_UNSET_PTR) {
|
||||||
rlcf->regex = ngx_array_create(cf->pool, 2, sizeof(ngx_regex_elt_t));
|
rlcf->regex = ngx_array_create(cf->pool, 2, sizeof(ngx_regex_elt_t));
|
||||||
if (rlcf->regex == NULL) {
|
if (rlcf->regex == NULL) {
|
||||||
|
@ -3551,6 +3551,12 @@ ngx_http_core_server_name(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
|
|||||||
ngx_str_t err;
|
ngx_str_t err;
|
||||||
u_char errstr[NGX_MAX_CONF_ERRSTR];
|
u_char errstr[NGX_MAX_CONF_ERRSTR];
|
||||||
|
|
||||||
|
if (value[i].len == 1) {
|
||||||
|
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
|
||||||
|
"empty regex in server name \"%V\"", &value[i]);
|
||||||
|
return NGX_CONF_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
err.len = NGX_MAX_CONF_ERRSTR;
|
err.len = NGX_MAX_CONF_ERRSTR;
|
||||||
err.data = errstr;
|
err.data = errstr;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user