mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
fix: dev: Check validator name when adding EDE text
When a validator is being shut down, the associated name `val->name` is set to NULL. This could cause a crash if a worker thread subsequently added an EDE code with `val->name` in the extra text. `validator_addede()` now checks whether the name is NULL before trying to add it to the extra text. Closes #5613 Merge branch 'each-validator-log-after-shutdown' into 'main' See merge request isc-projects/bind9!11945
This commit is contained in:
commit
a6b44a6007
1 changed files with 8 additions and 4 deletions
|
|
@ -3984,12 +3984,16 @@ validator_addede(dns_validator_t *val, uint16_t code, const char *extra) {
|
|||
|
||||
if (extra != NULL) {
|
||||
isc_buffer_putstr(&b, extra);
|
||||
isc_buffer_putuint8(&b, ' ');
|
||||
}
|
||||
|
||||
dns_name_totext(val->name, DNS_NAME_OMITFINALDOT, &b);
|
||||
isc_buffer_putuint8(&b, '/');
|
||||
dns_rdatatype_totext(val->type, &b);
|
||||
if (val->name != NULL) {
|
||||
if (extra != NULL) {
|
||||
isc_buffer_putuint8(&b, ' ');
|
||||
}
|
||||
dns_name_totext(val->name, DNS_NAME_OMITFINALDOT, &b);
|
||||
isc_buffer_putuint8(&b, '/');
|
||||
dns_rdatatype_totext(val->type, &b);
|
||||
}
|
||||
isc_buffer_putuint8(&b, '\0');
|
||||
|
||||
dns_ede_add(&val->edectx, code, bdata);
|
||||
|
|
|
|||
Loading…
Reference in a new issue