]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fix bad-cache assert
authorEvan Hunt <each@isc.org>
Mon, 2 Jul 2012 17:03:46 +0000 (10:03 -0700)
committerEvan Hunt <each@isc.org>
Mon, 2 Jul 2012 17:04:07 +0000 (10:04 -0700)
3346. [security] Bad-cache data could be used before it was
initialized, causing an assert. [RT #30025]

CHANGES
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index a018cd3bc4b9d5282216d64d4297366d801e116d..c07767aa4a91a8c444b419dea25411a0cb46d84e 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+3346.  [security]      Bad-cache data could be used before it was
+                       initialized, causing an assert. [RT #30025]
+
 3342.  [bug]           Change #3314 broke saving of stub zones to disk
                        resulting in excessive cpu usage in some cases.
                        [RT #29952]
index 1ae2f16bea3f5c273a311caec114c95a75a15a52..4c8b144486bee3cd5e2f586614f4a51d749209c4 100644 (file)
@@ -8448,6 +8448,7 @@ dns_resolver_addbadcache(dns_resolver_t *resolver, dns_name_t *name,
                        goto cleanup;
                bad->type = type;
                bad->hashval = hashval;
+               bad->expire = *expire;
                isc_buffer_init(&buffer, bad + 1, name->length);
                dns_name_init(&bad->name, NULL);
                dns_name_copy(name, &bad->name, &buffer);
@@ -8459,8 +8460,8 @@ dns_resolver_addbadcache(dns_resolver_t *resolver, dns_name_t *name,
                if (resolver->badcount < resolver->badhash * 2 &&
                    resolver->badhash > DNS_BADCACHE_SIZE)
                        resizehash(resolver, &now, ISC_FALSE);
-       }
-       bad->expire = *expire;
+       } else
+               bad->expire = *expire;
  cleanup:
        UNLOCK(&resolver->lock);
 }