]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Validate algorithm on assign
authorAki Tuomi <cmouse@desteem.org>
Tue, 31 Mar 2015 20:08:58 +0000 (23:08 +0300)
committerAki Tuomi <cmouse@desteem.org>
Tue, 31 Mar 2015 20:08:58 +0000 (23:08 +0300)
pdns/pdnssec.cc

index 428fbf92d5c95b82a7693d6e6a9dfdf18ab96ac5..a743c77207df201a59a5b41863895d80e2fdf6fa 100644 (file)
@@ -2096,6 +2096,11 @@ try
       }
 
       int algorithm = shorthand2algorithm(cmds[3]);
+      if (algorithm<0) {
+        cerr << "Unable to use unknown algorithm '" << cmds[3] << "'" << std::endl;
+        return 1;
+      }
+
       int id;
       bool keyOrZone = (cmds[4] == "ksk" ? true : false);
       string module = cmds[5];