Skip to content

Commit

Permalink
ICU-22589 Avoid timeout in TimeZone test
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankYFTang committed Dec 6, 2023
1 parent b246489 commit 2a3cb99
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions icu4c/source/test/fuzzer/timezone_create_fuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<char16_t[]> fuzzbuff(new char16_t[unistr_size]);
std::memcpy(fuzzbuff.get(), data, unistr_size * 2);
Expand Down

0 comments on commit 2a3cb99

Please sign in to comment.