summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-04-21 15:17:02 +0200
committerAttila Molnar <attilamolnar@hush.com>2015-04-21 15:17:02 +0200
commit92959a48b05aa982d5b1331622cb28197d38e9da (patch)
tree15fb80b8c5c891c1a86f3939b4cc1a743ce5fbf7
parenta28f095db832e44aad66bfd73bfd8176a97c6de2 (diff)
core_dns Reject incoming packets with qdcount != 1
-rw-r--r--src/coremods/core_dns.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/coremods/core_dns.cpp b/src/coremods/core_dns.cpp
index 999da8356..8911f5b55 100644
--- a/src/coremods/core_dns.cpp
+++ b/src/coremods/core_dns.cpp
@@ -236,6 +236,9 @@ class Packet : public Query
ServerInstance->Logs->Log(MODNAME, LOG_DEBUG, "qdcount: " + ConvToStr(qdcount) + " ancount: " + ConvToStr(ancount) + " nscount: " + ConvToStr(nscount) + " arcount: " + ConvToStr(arcount));
+ if (qdcount != 1)
+ throw Exception("Question count != 1 in incoming packet");
+
for (unsigned i = 0; i < qdcount; ++i)
this->questions.push_back(this->UnpackQuestion(input, len, packet_pos));