mirror of
https://github.com/nginx/nginx.git
synced 2024-12-18 21:23:36 -06:00
Core: fixed segfault with null in wildcard hash names.
A configuration like server { server_name .foo^@; } server { server_name .foo; } resulted in a segmentation fault during construction of server names hash. Reported by Markus Linnala. Found with afl-fuzz.
This commit is contained in:
parent
7930a6c442
commit
2c96914312
@ -743,6 +743,10 @@ ngx_hash_add_key(ngx_hash_keys_arrays_t *ha, ngx_str_t *key, void *value,
|
||||
if (key->data[i] == '.' && key->data[i + 1] == '.') {
|
||||
return NGX_DECLINED;
|
||||
}
|
||||
|
||||
if (key->data[i] == '\0') {
|
||||
return NGX_DECLINED;
|
||||
}
|
||||
}
|
||||
|
||||
if (key->len > 1 && key->data[0] == '.') {
|
||||
|
Loading…
Reference in New Issue
Block a user