]> granicus.if.org Git - pdns/commitdiff
Fix pdnsutil check-all-zones crash
authorChristian Hofstaedtler <christian.hofstaedtler@deduktiva.com>
Sat, 2 Jan 2016 18:20:18 +0000 (19:20 +0100)
committerChristian Hofstaedtler <christian.hofstaedtler@deduktiva.com>
Sat, 2 Jan 2016 18:20:18 +0000 (19:20 +0100)
Fixes #3147

pdns/pdnsutil.cc

index 7f02c289c51d5338e583c66aea25fb605112be1a..1198b673c648ce4c827a3ce28c392b6dd85a2e9a 100644 (file)
@@ -1570,7 +1570,7 @@ seedRandom(::arg()["entropy-source"]);
     dbBench(cmds.size() > 1 ? cmds[1] : "");
   }
   else if (cmds[0] == "check-all-zones") {
-    bool exitOnError = (cmds[1] == "exit-on-error");
+    bool exitOnError = ((cmds.size() > 2 ? cmds[1] : "") == "exit-on-error");
     exit(checkAllZones(dk, exitOnError));
   }
   else if (cmds[0] == "list-all-zones") {
@@ -1614,7 +1614,6 @@ seedRandom(::arg()["entropy-source"]);
     }
     verifyCrypto(cmds[1]);
   }
-
   else if(cmds[0] == "show-zone") {
     if(cmds.size() != 2) {
       cerr << "Syntax: pdnsutil show-zone ZONE"<<endl;