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

Unified 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, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « testing/libfuzzer/fuzzers/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/libfuzzer/fuzzers/base_json_reader_fuzzer.cc
diff --git a/testing/libfuzzer/fuzzers/dns_record_fuzzer.cc b/testing/libfuzzer/fuzzers/base_json_reader_fuzzer.cc
similarity index 62%
copy from testing/libfuzzer/fuzzers/dns_record_fuzzer.cc
copy to testing/libfuzzer/fuzzers/base_json_reader_fuzzer.cc
index 207b17cc09d9b37b3b89aeee7ab023ce0ecd2212..d275654b94aef943b5bc4bc7b8bbb393f159d73e 100644
--- a/testing/libfuzzer/fuzzers/dns_record_fuzzer.cc
+++ b/testing/libfuzzer/fuzzers/base_json_reader_fuzzer.cc
@@ -4,18 +4,14 @@
#include <string>
-#include "net/dns/dns_response.h"
+#include "base/json/json_reader.h"
+#include "base/values.h"
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const unsigned char* data,
unsigned long size) {
- std::string out;
- net::DnsRecordParser parser(data, size, 0);
- if (!parser.IsValid()) {
- return 0;
- }
- net::DnsResourceRecord record;
- while (parser.ReadRecord(&record)) {
- }
+ base::JSONReader reader;
+ reader.Read(std::string(reinterpret_cast<const char*>(data), size));
return 0;
}
+
« 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