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

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

Issue 2812503002: Initialize ICU before fuzzing the template URL parser. (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 | « 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/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 4d1b762032e18148fbf504cbb574a7b5073b1827..f98ad61bde2719d45c766f42f7db83c83c2c0ff3 100644
--- a/testing/libfuzzer/fuzzers/template_url_parser_fuzzer.cc
+++ b/testing/libfuzzer/fuzzers/template_url_parser_fuzzer.cc
@@ -8,6 +8,8 @@
#include <random>
#include <string>
+#include "base/at_exit.h"
+#include "base/i18n/icu_util.h"
#include "components/search_engines/search_terms_data.h"
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_parser.h"
@@ -34,6 +36,8 @@ 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();
jochen (gone - plz use gerrit) 2017/04/18 07:08:57 for posterity, we can't initialize ICU once per fu
const FuzzerFixedParams* params =
reinterpret_cast<const FuzzerFixedParams*>(data);
size -= sizeof(FuzzerFixedParams);
« 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