Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: testing/libfuzzer/fuzzers/base_json_reader_fuzzer.cc

Issue 1465283002: //base:json reader fuzzer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « testing/libfuzzer/fuzzers/BUILD.gn ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« no previous file with comments | « testing/libfuzzer/fuzzers/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698