mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-27 12:13:20 -04:00
Check whether zone->db is a valid pointer before attaching
The zone_resigninc() function does not check the validity of
'zone->db', which can crash named if the zone was unloaded earlier,
for example with "rndc delete".
Check that 'zone->db' is not 'NULL' before attaching to it, like
it is done in zone_sign() and zone_nsec3chain() functions, which
can similarly be called by zone maintenance.
(cherry picked from commit fae0930eb8)
This commit is contained in:
parent
9285538683
commit
7713d2cb6d
1 changed files with 7 additions and 1 deletions
|
|
@ -7220,8 +7220,14 @@ zone_resigninc(dns_zone_t *zone) {
|
|||
}
|
||||
|
||||
ZONEDB_LOCK(&zone->dblock, isc_rwlocktype_read);
|
||||
dns_db_attach(zone->db, &db);
|
||||
if (zone->db != NULL) {
|
||||
dns_db_attach(zone->db, &db);
|
||||
}
|
||||
ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read);
|
||||
if (db == NULL) {
|
||||
result = ISC_R_FAILURE;
|
||||
goto failure;
|
||||
}
|
||||
|
||||
result = dns_db_newversion(db, &version);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue