1
0
mirror of https://github.com/anope/anope.git synced 2026-07-04 07:43:12 +02:00

Fixed unpacking questions from dns packets

This commit is contained in:
Adam
2012-04-06 14:41:28 -04:00
parent e03b73e8cd
commit 9d249ef96f
+2 -2
View File
@@ -205,7 +205,7 @@ Question DNSPacket::UnpackQuestion(const unsigned char *input, unsigned short in
question.name = this->UnpackName(input, input_size, pos);
if (pos + 4 >= input_size)
if (pos + 4 > input_size)
throw SocketException("Unable to unpack question");
question.type = static_cast<QueryType>(input[pos] << 8 | input[pos + 1]);
@@ -221,7 +221,7 @@ ResourceRecord DNSPacket::UnpackResourceRecord(const unsigned char *input, unsig
{
ResourceRecord record = static_cast<ResourceRecord>(this->UnpackQuestion(input, input_size, pos));
if (pos + 6 >= input_size)
if (pos + 6 > input_size)
throw SocketException("Unable to unpack resource record");
record.ttl = (input[pos] << 24) | (input[pos + 1] << 16) | (input[pos + 2] << 8) | input[pos + 3];