From fedfd48a089450a8358742084c38fcfa443aeb9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 3 Oct 2019 10:16:03 +0200 Subject: [PATCH] lib/dns/zone.c: Fix invalid order of DbC checks that could cause dereference before NULL check --- lib/dns/zone.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dns/zone.c b/lib/dns/zone.c index be0865c891..c568e6a446 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -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++;