]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
check for val->name == NULL when adding EDE text 11945/head
authorEvan Hunt <each@isc.org>
Fri, 1 May 2026 18:12:54 +0000 (11:12 -0700)
committerEvan Hunt <each@isc.org>
Wed, 6 May 2026 20:47:43 +0000 (20:47 +0000)
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.

lib/dns/validator.c

index c5698a7c3ed28587932cdd99eecf45d0b848d6b0..482909b33d4232aeff09f5f906ba8ef3299b0e22 100644 (file)
@@ -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);