From 694c1281b267f6ccd125ef2e57461e6fa0f39f0a Mon Sep 17 00:00:00 2001 From: Otto Date: Wed, 27 Oct 2021 09:38:10 +0200 Subject: [PATCH] wipe-cache-typed should check if a qtype arg is present and valid (cherry picked from commit a721f7b21a75cefaa189bf84b14979facde7d3ab) --- pdns/rec_channel_rec.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index 44913e44fb..da4216aa0c 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -1855,7 +1855,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)}; } -- 2.47.2