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

Unified Diff: net/cert/internal/verify_name_match_fuzzer.cc

Issue 2308443002: Make FuzzedDataProvider vend std::strings (Closed)
Patch Set: thestig review Created 4 years, 2 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
Index: net/cert/internal/verify_name_match_fuzzer.cc
diff --git a/net/cert/internal/verify_name_match_fuzzer.cc b/net/cert/internal/verify_name_match_fuzzer.cc
index 464108e51d287cce18330b1e09285e4392b8e757..3b5f74cf261d15fb496e023b34b0ab03be370461 100644
--- a/net/cert/internal/verify_name_match_fuzzer.cc
+++ b/net/cert/internal/verify_name_match_fuzzer.cc
@@ -11,11 +11,11 @@
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
base::FuzzedDataProvider fuzzed_data(data, size);
size_t first_part_size = fuzzed_data.ConsumeUint16();
- base::StringPiece first_part = fuzzed_data.ConsumeBytes(first_part_size);
- base::StringPiece second_part = fuzzed_data.ConsumeRemainingBytes();
+ std::string first_part = fuzzed_data.ConsumeBytes(first_part_size);
+ std::string second_part = fuzzed_data.ConsumeRemainingBytes();
- net::der::Input in1(first_part);
- net::der::Input in2(second_part);
+ net::der::Input in1(&first_part);
+ net::der::Input in2(&second_part);
bool match = net::VerifyNameMatch(in1, in2);
bool reverse_order_match = net::VerifyNameMatch(in2, in1);
// Result should be the same regardless of argument order.
« no previous file with comments | « base/test/fuzzed_data_provider.cc ('k') | net/cert/internal/verify_name_match_verifynameinsubtree_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698