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

Unified Diff: testing/libfuzzer/fuzzers/template_url_parser_fuzzer.cc

Issue 2820133004: Only initialize ICU once in the template URL parser fuzzer. (Closed)
Patch Set: Created 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/libfuzzer/fuzzers/template_url_parser_fuzzer.cc
diff --git a/testing/libfuzzer/fuzzers/template_url_parser_fuzzer.cc b/testing/libfuzzer/fuzzers/template_url_parser_fuzzer.cc
index f98ad61bde2719d45c766f42f7db83c83c2c0ff3..93ce6dea812d3f7f31e4a8ccee9cc5b121e38936 100644
--- a/testing/libfuzzer/fuzzers/template_url_parser_fuzzer.cc
+++ b/testing/libfuzzer/fuzzers/template_url_parser_fuzzer.cc
@@ -32,12 +32,17 @@ struct FuzzerFixedParams {
uint32_t seed_;
};
+base::AtExitManager at_exit_manager; // used by ICU integration
+
+extern "C" int LLVMFuzzerInitialize(int argc, char*** argv) {
+ CHECK(base::i18n::InitializeICU());
+ return 0;
+}
+
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
if (size < sizeof(FuzzerFixedParams)) {
return 0;
}
- base::AtExitManager at_exit_manager; // used by ICU integration.
- base::i18n::InitializeICU();
const FuzzerFixedParams* params =
reinterpret_cast<const FuzzerFixedParams*>(data);
size -= sizeof(FuzzerFixedParams);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698