Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fixed out of bounds memory access from malformed DNS queries that hav…
…e an invalid length label. Introduced in a6a07de.
  • Loading branch information
Adam- committed Mar 26, 2012
1 parent 7fcda51 commit ed28c1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dns.cpp
Expand Up @@ -760,7 +760,7 @@ DNSInfo DNSRequest::ResultIsReady(DNSHeader &header, unsigned length)
else i += header.payload[i] + 1; /* skip length and label */
}
}
if (length - i < 10)
if (static_cast<int>(length - i) < 10)
return std::make_pair((unsigned char*)NULL,"Incorrectly sized DNS reply");

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

0 comments on commit ed28c1b

Please sign in to comment.