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.6.0-beta1~27^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F10905%2Fhead;p=thirdparty%2Fpdns.git wipe-cache-typed should check if a qtype arg is present and valid --- diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index 8ab3007b0e..d15bcf4c77 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -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)}; }