fix bad-cache assert

3346.	[security]	Bad-cache data could be used before it was
			initialized, causing an assert. [RT #30025]
This commit is contained in:
Evan Hunt
2012-07-02 10:03:46 -07:00
parent d725bd5ca2
commit 42b8ca8347
2 changed files with 6 additions and 2 deletions
+3
View File
@@ -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]
+3 -2
View File
@@ -8472,6 +8472,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);
@@ -8483,8 +8484,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);
}