]> granicus.if.org Git - pdns/commitdiff
improve syntax checking for pdnssec
authorBert Hubert <bert.hubert@netherlabs.nl>
Tue, 11 Jan 2011 21:42:56 +0000 (21:42 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Tue, 11 Jan 2011 21:42:56 +0000 (21:42 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1873 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/pdnssec.cc

index dbc0cb43a3567a374f4da5933cd1997fb40c3542..d93c9140dedfcc9e821e3abd1416b0bc0c987d8e 100644 (file)
@@ -315,6 +315,10 @@ try
     dk.addKey(zone, keyOrZone, algorithm, bits); 
   }
   else if(cmds[0] == "remove-zone-key") {
+    if(cmds.size() < 3) {
+      cerr<<"Syntax: pdnssec remove-zone-key ZONE KEY-ID\n";
+      return 0;
+    }
     const string& zone=cmds[1];
     unsigned int id=atoi(cmds[2].c_str());
     dk.removeKey(zone, id);