Skip to content

Commit

Permalink
ICU-22588 Limit test data to avoid meaningless timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankYFTang committed Dec 6, 2023
1 parent bcae6f2 commit b246489
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions icu4c/source/test/fuzzer/collator_rulebased_fuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ IcuEnvironment* env = new IcuEnvironment();

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
UErrorCode status = U_ZERO_ERROR;
if (size > 2000) {
// Limit the effective test data to only 2000 bytes to avoid meaningless
// timeout.
size = 2000;
}

size_t unistr_size = size/2;
std::unique_ptr<char16_t[]> fuzzbuff(new char16_t[unistr_size]);
Expand Down

0 comments on commit b246489

Please sign in to comment.