Prevent check_stale_header() from leaking rdataset headers

check_stale_header() fails to update the pointer to the previous header
while processing rdataset headers eligible for serve-stale, thus
enabling rdataset headers to be leaked (i.e. disassociated from a node
and left on the relevant TTL heap) while iterating through a node.  This
can lead to several different assertion failures.  Add the missing
pointer update.
This commit is contained in:
Michał Kępień 2018-04-27 09:13:26 +02:00 committed by Evan Hunt
parent e8dd921ef9
commit 391fac1fc8

View file

@ -4494,6 +4494,7 @@ check_stale_header(dns_rbtnode_t *node, rdatasetheader_t *header,
*/
if (KEEPSTALE(search->rbtdb) && stale > search->now) {
header->attributes |= RDATASET_ATTR_STALE;
*header_prev = header;
return ((search->options & DNS_DBFIND_STALEOK) == 0);
}