]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
check for val->name == NULL when adding EDE text 11977/head
authorEvan Hunt <each@isc.org>
Fri, 1 May 2026 18:12:54 +0000 (11:12 -0700)
committerMark Andrews <marka@isc.org>
Thu, 7 May 2026 01:23:17 +0000 (11:23 +1000)
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)

lib/dns/validator.c

index b3c0a52a29806d73aeaaeeb2c6b971b112472466..dc7b990fc1dce97a2966be88b7095e7e7ba943b9 100644 (file)
@@ -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);