| Index: net/dns/dns_response_unittest.cc
|
| diff --git a/net/dns/dns_response_unittest.cc b/net/dns/dns_response_unittest.cc
|
| index 43a1b3a00e329a3d1bf5c76df33eb3e4a731b320..792213781ffb6123c383bab11df920159d04e765 100644
|
| --- a/net/dns/dns_response_unittest.cc
|
| +++ b/net/dns/dns_response_unittest.cc
|
| @@ -378,6 +378,20 @@ TEST(DnsResponseTest, InitParseWithoutQueryTwoQuestions) {
|
| EXPECT_FALSE(parser.ReadRecord(&record));
|
| }
|
|
|
| +TEST(DnsResponseTest, InitParseWithoutQueryPacketTooShort) {
|
| + const uint8 response_data[] = {
|
| + // Header
|
| + 0xca, 0xfe, // ID
|
| + 0x81, 0x80, // Standard query response, RA, no error
|
| + 0x00, 0x00, // No question
|
| + };
|
| +
|
| + DnsResponse resp;
|
| + memcpy(resp.io_buffer()->data(), response_data, sizeof(response_data));
|
| +
|
| + EXPECT_FALSE(resp.InitParseWithoutQuery(sizeof(response_data)));
|
| +}
|
| +
|
| void VerifyAddressList(const std::vector<const char*>& ip_addresses,
|
| const AddressList& addrlist) {
|
| ASSERT_EQ(ip_addresses.size(), addrlist.size());
|
|
|