]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
fix unchecked null; value not read
authorMark Andrews <marka@isc.org>
Sat, 13 Jul 2013 14:26:23 +0000 (00:26 +1000)
committerMark Andrews <marka@isc.org>
Sat, 13 Jul 2013 14:26:23 +0000 (00:26 +1000)
lib/dns/zone.c

index a8d78614e18f386deb8378818de550dc338f9be0..5f5b510bd98691313fe3f6c01a9ee70b85074c6b 100644 (file)
@@ -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)