]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
wipe-cache-typed should check if a qtype arg is present and valid 10909/head
authorOtto <otto.moerbeek@open-xchange.com>
Wed, 27 Oct 2021 07:38:10 +0000 (09:38 +0200)
committerOtto <otto.moerbeek@open-xchange.com>
Wed, 27 Oct 2021 11:52:42 +0000 (13:52 +0200)
(cherry picked from commit a721f7b21a75cefaa189bf84b14979facde7d3ab)

pdns/rec_channel_rec.cc

index d5b82f8dfdbdc7d4865cd456335e61437fd51a71..1376034f0771071338c9cc293629cf8d5b63699c 100644 (file)
@@ -1790,7 +1790,13 @@ string RecursorControlParser::getAnswer(const string& question, RecursorControlP
     return doWipeCache(begin, end, 0xffff);
 
   if(cmd=="wipe-cache-typed") {
+    if (begin == end) {
+      return "Need a qtype\n";
+    }
     uint16_t qtype = QType::chartocode(begin->c_str());
+    if (qtype == 0) {
+      return "Unknown qtype " + *begin + "\n";
+    }
     ++begin;
     return doWipeCache(begin, end, qtype);
   }