]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Use result of first_*_header() calls instead of direct value
authorOndřej Surý <ondrej@isc.org>
Sat, 13 Sep 2025 04:10:29 +0000 (06:10 +0200)
committerOndřej Surý <ondrej@isc.org>
Tue, 16 Sep 2025 16:47:53 +0000 (18:47 +0200)
Fix places where we got the header by calling first_*_header() function,
but then worked with top->header instead of the result.

lib/dns/qpcache.c

index 0d0e9b1bd2b9d08d76317d5b49d0ef2406c8bcdd..06d9a91b0445ccd1b280b9ce03f0490c25eab67d 100644 (file)
@@ -474,7 +474,7 @@ first_header(dns_slabtop_t *top) {
 static dns_slabheader_t *
 first_existing_header(dns_slabtop_t *top) {
        dns_slabheader_t *header = first_header(top);
-       if (EXISTS(top->header)) {
+       if (EXISTS(header)) {
                return header;
        }
        return NULL;
@@ -2933,7 +2933,7 @@ add(qpcache_t *qpdb, qpcnode_t *qpnode, dns_slabheader_t *newheader,
                        dns_slabheader_t *expireheader =
                                first_header(expiretop);
                        if (expireheader != NULL) {
-                               mark_ancient(expiretop->header);
+                               mark_ancient(expireheader);
                        }
                        /*
                         * FIXME: In theory, we should mark the RRSIG