OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <string> | 5 #include <string> |
6 | 6 |
7 #include "net/dns/dns_response.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/values.h" |
8 | 9 |
9 // Entry point for LibFuzzer. | 10 // Entry point for LibFuzzer. |
10 extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data, | 11 extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data, |
11 unsigned long size) { | 12 unsigned long size) { |
12 std::string out; | 13 base::JSONReader reader; |
13 net::DnsRecordParser parser(data, size, 0); | 14 reader.Read(std::string(reinterpret_cast<const char*>(data), size)); |
14 if (!parser.IsValid()) { | |
15 return 0; | |
16 } | |
17 net::DnsResourceRecord record; | |
18 while (parser.ReadRecord(&record)) { | |
19 } | |
20 return 0; | 15 return 0; |
21 } | 16 } |
| 17 |
OLD | NEW |