From daac4d850d247c4c0ae97bf10ccefd5287852699 Mon Sep 17 00:00:00 2001 From: Frank Tang Date: Mon, 4 Dec 2023 13:27:33 -0800 Subject: [PATCH] ICU-22589 Avoid timeout in TimeZone test --- icu4c/source/test/fuzzer/timezone_create_fuzzer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/icu4c/source/test/fuzzer/timezone_create_fuzzer.cpp b/icu4c/source/test/fuzzer/timezone_create_fuzzer.cpp index 39e0913a5dfa..490c58f1e1e7 100644 --- a/icu4c/source/test/fuzzer/timezone_create_fuzzer.cpp +++ b/icu4c/source/test/fuzzer/timezone_create_fuzzer.cpp @@ -11,6 +11,10 @@ IcuEnvironment* env = new IcuEnvironment(); extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + // Limit the test for at most 1000 Unicode characters. + if (size > 2000) { + size = 2000; + } size_t unistr_size = size/2; std::unique_ptr fuzzbuff(new char16_t[unistr_size]); std::memcpy(fuzzbuff.get(), data, unistr_size * 2);