]> 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 10:43:31 +0000 (11:43 +0100)
commit43cf27d0c219b74cbd39c2b95f7ba2b681310e4a
tree936456cae9dcf6e0720c52e8d3269f2cdf918726
parentef714e91acf7d5333f77e95476cbe99886cc8a0d
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 89478d95c39768793fa17dffaa2ca02cbd75f643)
lib/dns/qpzone.c