]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: Check that the domain exists in pdnsutil check-zone
authorRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 29 May 2019 09:48:47 +0000 (11:48 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 29 May 2019 09:48:47 +0000 (11:48 +0200)
Reported by Coverity (CID 1401633).

pdns/pdnsutil.cc

index 5abce3b4db3f851bf6da0a7c521c2ea2da705409..5568b9afde2922f81872e73dc0ac533d59a62639 100644 (file)
@@ -244,7 +244,10 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, const vect
 
   DomainInfo di;
   try {
-    B.getDomainInfo(zone, di);
+    if (!B.getDomainInfo(zone, di)) {
+      cout<<"[Error] Unable to get domain information for zone '"<<zone<<"'"<<endl;
+      return 1;
+    }
   } catch(const PDNSException &e) {
     if (di.kind == DomainInfo::Slave) {
       cout<<"[Error] non-IP address for masters: "<<e.reason<<endl;