lib/dns/zone.c: Fix invalid order of DbC checks that could cause dereference before NULL check

This commit is contained in:
Ondřej Surý 2019-10-03 10:16:03 +02:00
parent 6a82289e35
commit fedfd48a08

View file

@ -5507,8 +5507,8 @@ zone_iattach(dns_zone_t *source, dns_zone_t **target) {
/*
* 'source' locked by caller.
*/
REQUIRE(LOCKED_ZONE(source));
REQUIRE(DNS_ZONE_VALID(source));
REQUIRE(LOCKED_ZONE(source));
REQUIRE(target != NULL && *target == NULL);
INSIST(source->irefs + isc_refcount_current(&source->erefs) > 0);
source->irefs++;