Chromium Code Reviews| Index: net/dns/dns_response.cc |
| diff --git a/net/dns/dns_response.cc b/net/dns/dns_response.cc |
| index 4a3371c2adb1b42b267f7a1c161ca58f191f94f4..5102d00cadabca036228df151c3c31265d612fb0 100644 |
| --- a/net/dns/dns_response.cc |
| +++ b/net/dns/dns_response.cc |
| @@ -190,7 +190,9 @@ bool DnsResponse::InitParse(int nbytes, const DnsQuery& query) { |
| } |
| bool DnsResponse::InitParseWithoutQuery(int nbytes) { |
| - if (nbytes >= io_buffer_->size()) |
| + if (nbytes < 0 || |
|
szym
2013/05/17 20:43:21
nbytes < 0 is an error. You should probably DCHECK
Noam Samuel
2013/05/17 20:52:44
Done.
|
| + (unsigned)nbytes < sizeof(dns_protocol::Header) || |
| + nbytes >= io_buffer_->size()) |
| return false; |
| size_t hdr_size = sizeof(dns_protocol::Header); |