]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Assert current_version in qpzone_destroy()
authorMichal Nowak <mnowak@isc.org>
Mon, 29 Jun 2026 11:41:57 +0000 (11:41 +0000)
committerMichal Nowak <mnowak@isc.org>
Thu, 23 Jul 2026 12:22:12 +0000 (14:22 +0200)
current_version is a lifetime invariant and never NULL.  Assert it to
silence a scan-build false positive:

    lib/dns/qpzone.c:593:2: warning: Dereference of null pointer [core.NullDereference]

Assisted-by: Claude:claude-opus-4-8
lib/dns/qpzone.c

index 02353d878da66e176a7ddb72bf10db6ba0182b57..23749db8b3fd9aae431d719396723c37e685bb12 100644 (file)
@@ -586,6 +586,7 @@ free_db_rcu(struct rcu_head *rcu_head) {
 static void
 qpzone_destroy(qpzonedb_t *qpdb) {
        REQUIRE(qpdb->future_version == NULL);
+       REQUIRE(qpdb->current_version != NULL);
 
        isc_refcount_decrementz(&qpdb->current_version->references);