Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICU-22563 Limit the size for calendar fuzzer #2695

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions icu4c/source/test/fuzzer/calendar_fuzzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ const char* GetRandomCalendarType(uint8_t rnd) {

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
uint16_t rnd;
// Set the limit for the test data to 1000 bytes to avoid timeout for a
// very long list of operations.
if (size > 1000) { size = 1000; }
if (size < 2*sizeof(rnd) + 1) return 0;
icu::StringPiece fuzzData(reinterpret_cast<const char *>(data), size);
// Byte 0 and 1 randomly select a TimeZone
Expand Down