From: Otto Date: Wed, 27 Oct 2021 07:38:10 +0000 (+0200) Subject: wipe-cache-typed should check if a qtype arg is present and valid X-Git-Tag: rec-4.4.7~1^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F10909%2Fhead;p=thirdparty%2Fpdns.git wipe-cache-typed should check if a qtype arg is present and valid (cherry picked from commit a721f7b21a75cefaa189bf84b14979facde7d3ab) --- diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index d5b82f8dfd..1376034f07 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -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); }