mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
Fixed handling of conflicting wildcard server names.
With previous code wildcard names were added to hash even if conflict was detected. This resulted in identical names in hash and segfault later in ngx_hash_wildcard_init().
This commit is contained in:
parent
859dc4ce01
commit
40a366c5a8
@ -924,17 +924,6 @@ wildcard:
|
||||
}
|
||||
|
||||
|
||||
hk = ngx_array_push(hwc);
|
||||
if (hk == NULL) {
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
hk->key.len = last - 1;
|
||||
hk->key.data = p;
|
||||
hk->key_hash = 0;
|
||||
hk->value = value;
|
||||
|
||||
|
||||
/* check conflicts in wildcard hash */
|
||||
|
||||
name = keys->elts;
|
||||
@ -972,5 +961,18 @@ wildcard:
|
||||
|
||||
ngx_memcpy(name->data, key->data + skip, name->len);
|
||||
|
||||
|
||||
/* add to wildcard hash */
|
||||
|
||||
hk = ngx_array_push(hwc);
|
||||
if (hk == NULL) {
|
||||
return NGX_ERROR;
|
||||
}
|
||||
|
||||
hk->key.len = last - 1;
|
||||
hk->key.data = p;
|
||||
hk->key_hash = 0;
|
||||
hk->value = value;
|
||||
|
||||
return NGX_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user