]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Assert rpz_ready() yields an rdataset in rpz_find_p()
authorMichal Nowak <mnowak@isc.org>
Mon, 29 Jun 2026 11:41:37 +0000 (11:41 +0000)
committerMichal Nowak <mnowak@isc.org>
Thu, 23 Jul 2026 12:22:12 +0000 (14:22 +0200)
A successful rpz_ready() always leaves *rdatasetp non-NULL.  Assert it
to silence a scan-build false positive:

    lib/ns/query.c:3136:7: warning: Access to field 'type' results in a dereference of a null pointer [core.NullDereference]

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

index 0b14141b5c3d4f6dd0ea4a6edc5bdece14a5a88c..26c81d4f029748a487a44508e2666de467d9257f 100644 (file)
@@ -3003,6 +3003,7 @@ rpz_find_p(ns_client_t *client, dns_name_t *self_name, dns_rdatatype_t qtype,
                CTRACE(ISC_LOG_ERROR, "rpz_ready() failed");
                return DNS_R_SERVFAIL;
        }
+       INSIST(*rdatasetp != NULL);
        *versionp = NULL;
        result = rpz_getdb(client, p_name, rpz_type, zonep, dbp, versionp);
        if (result != ISC_R_SUCCESS) {