]> git.ipfire.org Git - thirdparty/bind9.git/commit
named crashes on shutdown after load rpz failed
authorMatthijs Mekking <matthijs@isc.org>
Thu, 7 Feb 2019 14:25:28 +0000 (15:25 +0100)
committerMatthijs Mekking <github@pletterpet.nl>
Fri, 22 Feb 2019 14:23:33 +0000 (15:23 +0100)
commit48d7e4bb407bb09ed17193267937793ec4585446
treeab882fe3d7f813c45890a431397a4bc493daa4a0
parente2def297b6c1e5e964a51ed726870988101f51af
named crashes on shutdown after load rpz failed

This may happen when loading an RPZ failed and the code path skips
calling dns_db_endload().  The dns_rpz_zone_t object is still kept
marked as having registered db.  So when this object is finally
destroyed in rpz_detach(), this code will incorrectly call
`dns_db_updatenotify_unregister()`:

   if (rpz->db_registered)
     dns_db_updatenotify_unregister(rpz->db,
                                    dns_rpz_dbupdate_callback, rpz);

and trigger this assertion failure:

   REQUIRE(db != NULL);

To fix this, only call `dns_db_updatenotify_unregister()` when
`rpz->db` is not NULL.
lib/dns/rpz.c
lib/dns/zone.c