]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
wipe-cache-typed should check if a qtype arg is present and valid 10905/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 07:45:28 +0000 (09:45 +0200)
pdns/rec_channel_rec.cc

index 8ab3007b0ed47e354ea241895113429363fda0a8..d15bcf4c776ce91e116a3fe8712e64ccf49d8ecb 100644 (file)
@@ -2017,7 +2017,13 @@ RecursorControlChannel::Answer RecursorControlParser::getAnswer(int s, const str
     return {0, doWipeCache(begin, end, 0xffff)};
   }
   if (cmd == "wipe-cache-typed") {
+    if (begin == end) {
+      return {1, "Need a qtype\n"};
+    }
     uint16_t qtype = QType::chartocode(begin->c_str());
+    if (qtype == 0) {
+      return {1, "Unknown qtype " + *begin + "\n"};
+    }
     ++begin;
     return {0, doWipeCache(begin, end, qtype)};
   }