Chromium Code Reviews| Index: net/dns/dns_response.cc |
| diff --git a/net/dns/dns_response.cc b/net/dns/dns_response.cc |
| index 354622d53801f20eafa5cc81fa8841ae17c14770..625e7c041dc0ddfc0eb5c02dc650b22d58fba7d2 100644 |
| --- a/net/dns/dns_response.cc |
| +++ b/net/dns/dns_response.cc |
| @@ -131,6 +131,10 @@ DnsResponse::DnsResponse() |
| : io_buffer_(new IOBufferWithSize(dns_protocol::kMaxUDPSize + 1)) { |
| } |
| +DnsResponse::DnsResponse(size_t length) |
| + : io_buffer_(new IOBufferWithSize(length)) { |
| +} |
| + |
| DnsResponse::DnsResponse(const void* data, |
| size_t length, |
| size_t answer_offset) |
| @@ -145,7 +149,7 @@ DnsResponse::~DnsResponse() { |
| bool DnsResponse::InitParse(int nbytes, const DnsQuery& query) { |
| // Response includes query, it should be at least that size. |
| - if (nbytes < query.io_buffer()->size() || nbytes > dns_protocol::kMaxUDPSize) |
| + if (nbytes < query.io_buffer()->size() || nbytes >= io_buffer_->size()) |
|
mmenke
2012/12/19 17:15:48
Ahh...So why are you using ">=" rather than ">"?
szym
2012/12/19 18:16:24
If this check was ">", then there is no way to cat
mmenke
2012/12/19 18:21:29
Thanks for the explanation.
|
| return false; |
| // Match the query id. |