From 09fec186691a7f75cfa65466fccdc5dae0337889 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Sun, 14 Jul 2013 00:26:23 +1000 Subject: [PATCH] fix unchecked null; value not read --- lib/dns/zone.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/dns/zone.c b/lib/dns/zone.c index a8d78614e1..5f5b510bd9 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -2983,6 +2983,11 @@ zone_addnsec3chain(dns_zone_t *zone, dns_rdata_nsec3param_t *nsec3param) { dns_db_attach(zone->db, &db); ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read); + if (db == NULL) { + result = ISC_R_SUCCESS; + goto cleanup; + } + dns_db_currentversion(db, &version); result = dns_nsec_nseconly(db, version, &nseconly); nsec3ok = (result == ISC_R_SUCCESS && !nseconly); @@ -3121,10 +3126,8 @@ resume_addnsec3chain(dns_zone_t *zone) { if (zone->db != NULL) dns_db_attach(zone->db, &db); ZONEDB_UNLOCK(&zone->dblock, isc_rwlocktype_read); - if (db == NULL) { - result = ISC_R_FAILURE; + if (db == NULL) goto cleanup; - } result = dns_db_findnode(db, &zone->origin, ISC_FALSE, &node); if (result != ISC_R_SUCCESS)