dns_rbtnodechain_prev requires the current node to still be valid
which was not always the case after dereference_iter_node was called.
Move the call to dereference_iter_node to after the dns_rbtnodechain_prev
to preserve the node.
(cherry picked from commit
b677d31fca2e54ca28318dd2b86e5cfe5bedb26c)
resume_iteration(rbtdbiter);
}
- dereference_iter_node(rbtdbiter DNS__DB_FLARG_PASS);
-
name = dns_fixedname_name(&rbtdbiter->name);
origin = dns_fixedname_name(&rbtdbiter->origin);
result = dns_rbtnodechain_prev(rbtdbiter->current, name, origin);
+
+ dereference_iter_node(rbtdbiter DNS__DB_FLARG_PASS);
+
if (rbtdbiter->current == &rbtdbiter->nsec3chain &&
(result == ISC_R_SUCCESS || result == DNS_R_NEWORIGIN))
{