]> git.ipfire.org Git - thirdparty/bind9.git/commit
In dns_qpiter_{prev,next}, defer dereference_iter_node call
authorOndřej Surý <ondrej@isc.org>
Fri, 5 Dec 2025 11:29:32 +0000 (12:29 +0100)
committerAndoni Duarte Pintado <andoni@isc.org>
Tue, 9 Dec 2025 09:50:37 +0000 (10:50 +0100)
commit48da8804fbd0a9d1fced81a38d2a7c6b4c1999d8
tree73ac3e4729153ad4fd7e91504cee8286beb9dc30
parenta45d253882764090643a0436f85b94d2a5d520d6
In dns_qpiter_{prev,next}, defer dereference_iter_node call

dns_qpiter_{prev,next} requires the current iterator node to still be
valid which might not always the case after dereference_iter_node was
called.  Currently, this is ensured via closeversion() mechanism, but it
is not guaranteed to be true in the future.

Move the call to dereference_iter_node to after the dns_qpiter_prev()
and dns_qpiter_next() to prevent a possible use-after-free of the
current iterator node.

(cherry picked from commit 9914bd383ecd3f1dc1ed0a98171c79f0614988b3)
lib/dns/qpzone.c