From: Evan Hunt Date: Fri, 1 May 2026 18:12:54 +0000 (-0700) Subject: check for val->name == NULL when adding EDE text X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c665472b10d5e49dc5154112aebbe48e40f824f8;p=thirdparty%2Fbind9.git check for val->name == NULL 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 to the response containing val->name in the extra text. `validator_addede()` now checks whether the name is NULL before trying to add it to the extra text. (cherry picked from commit 2c608705274df6ac0737a1444992c39ab2562011) --- diff --git a/lib/dns/validator.c b/lib/dns/validator.c index b3c0a52a298..dc7b990fc1d 100644 --- a/lib/dns/validator.c +++ b/lib/dns/validator.c @@ -3800,12 +3800,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);