We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 892d449 commit d3ea45aCopy full SHA for d3ea45a
icu4c/source/test/fuzzer/fuzzer_driver.cpp
@@ -12,6 +12,8 @@
12
13
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size);
14
15
+constexpr size_t kFuzzerTestDataSizeLimit = 32 * 1024; // Limit to 32K bytes
16
+
17
int main(int argc, char* argv[])
18
{
19
bool show_warning = true;
@@ -52,7 +54,11 @@ int main(int argc, char* argv[])
52
54
}
53
55
std::ostringstream ostrm;
56
ostrm << file.rdbuf();
- LLVMFuzzerTestOneInput(reinterpret_cast<const uint8_t*>(ostrm.str().c_str()), ostrm.str().size());
57
+ size_t data_size = ostrm.str().size();
58
+ if (data_size > kFuzzerTestDataSizeLimit) {
59
+ data_size = kFuzzerTestDataSizeLimit;
60
+ }
61
+ LLVMFuzzerTestOneInput(reinterpret_cast<const uint8_t*>(ostrm.str().c_str()), data_size);
62
63
return 0;
64
0 commit comments