Skip to content

Commit ed28c1b

Browse files
committed
Fixed out of bounds memory access from malformed DNS queries that have an invalid length label. Introduced in a6a07de.
1 parent 7fcda51 commit ed28c1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/dns.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ DNSInfo DNSRequest::ResultIsReady(DNSHeader &header, unsigned length)
760760
else i += header.payload[i] + 1; /* skip length and label */
761761
}
762762
}
763-
if (length - i < 10)
763+
if (static_cast<int>(length - i) < 10)
764764
return std::make_pair((unsigned char*)NULL,"Incorrectly sized DNS reply");
765765

766766
/* XXX: We actually initialise 'rr' here including its ttl field */

0 commit comments

Comments
 (0)