]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Assert rdataset precondition in query_addrrset()
authorMichal Nowak <mnowak@isc.org>
Mon, 29 Jun 2026 11:41:20 +0000 (11:41 +0000)
committerMichal Nowak <mnowak@isc.org>
Thu, 23 Jul 2026 12:22:12 +0000 (14:22 +0200)
rdataset is always non-NULL and is dereferenced unconditionally below.
Make the precondition explicit to silence a scan-build false positive:

    lib/ns/query.c:2254:11: warning: Access to field 'type' results in a dereference of a null pointer (loaded from variable 'rdataset') [core.NullDereference]

Assisted-by: Claude:claude-opus-4-8
lib/ns/query.c

index 306f6e3bcebcad92d15208571d0f9cc56dc7cc5e..0b14141b5c3d4f6dd0ea4a6edc5bdece14a5a88c 100644 (file)
@@ -2172,6 +2172,7 @@ query_addrrset(query_ctx_t *qctx, dns_name_t **namep,
        CTRACE(ISC_LOG_DEBUG(3), "query_addrrset");
 
        REQUIRE(name != NULL);
+       REQUIRE(rdataset != NULL);
 
        if (sigrdatasetp != NULL) {
                sigrdataset = *sigrdatasetp;