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

Unified Diff: net/dns/dns_hosts_parse_fuzzer.cc

Issue 1920093005: Add a fuzzer for DNS hosts parser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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 | « net/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_hosts_parse_fuzzer.cc
diff --git a/components/webcrypto/rsa_import_key_pkcs8_fuzzer.cc b/net/dns/dns_hosts_parse_fuzzer.cc
similarity index 64%
copy from components/webcrypto/rsa_import_key_pkcs8_fuzzer.cc
copy to net/dns/dns_hosts_parse_fuzzer.cc
index 184012299e576afa4f344f2a04c7762e27a78ca3..0f82e8ab51051de82a7a9fd6c3c55c57cd50536a 100644
--- a/components/webcrypto/rsa_import_key_pkcs8_fuzzer.cc
+++ b/net/dns/dns_hosts_parse_fuzzer.cc
@@ -5,11 +5,14 @@
#include <stddef.h>
#include <stdint.h>
-#include "components/webcrypto/fuzzer_support.h"
+#include <string>
+
+#include "net/dns/dns_hosts.h"
// Entry point for LibFuzzer.
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
- webcrypto::ImportRsaKeyFromDerFuzzData(data, size,
- blink::WebCryptoKeyFormatPkcs8);
+ std::string input(reinterpret_cast<const char*>(data), size);
+ net::DnsHosts dns_hosts;
+ net::ParseHosts(input, &dns_hosts);
mmenke 2016/04/28 16:20:03 I'd suggest calling ParseHostsWithCommaModeForTest
Zhongyi Shi 2016/04/28 17:35:17 Done. Thanks:D
return 0;
}
« no previous file with comments | « net/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698