]> git.ipfire.org Git - thirdparty/bind9.git/commit
Resolve violation of weak referencing dns_view
authorOndřej Surý <ondrej@isc.org>
Mon, 3 Oct 2022 13:54:12 +0000 (15:54 +0200)
committerEvan Hunt <each@isc.org>
Wed, 5 Oct 2022 18:59:36 +0000 (11:59 -0700)
commitbff30253960263c5530e62dd7e27c20484e5cc26
tree5a45966227485d240bec3038d39f89aa096e32cf
parent934a6a8b8feec4addd891e04267bc8dfa51c6324
Resolve violation of weak referencing dns_view

The dns_view implements weak and strong reference counting.  When strong
reference counting reaches zero, the adb, ntatable and resolver objects
are shut down and detached.

In dns_zone and dns_nta the dns_view was weakly attached, but the
view->resolver reference was accessed directly leading to dereferencing
the NULL pointer.

Add dns_view_getresolver() method which attaches to view->resolver
object under the lock (if it still exists) ensuring the dns_resolver
will be kept referenced until not needed.
lib/dns/include/dns/view.h
lib/dns/nta.c
lib/dns/view.c
lib/dns/zone.c
tests/dns/keytable_test.c