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 531c2b7 commit faafda2Copy full SHA for faafda2
src/test/fuzz/prevector.cpp
@@ -206,10 +206,14 @@ class prevector_tester
206
207
FUZZ_TARGET(prevector)
208
{
209
+ // Pick an arbitrary upper bound to limit the runtime and avoid timeouts on
210
+ // inputs.
211
+ int limit_max_ops{3000};
212
+
213
FuzzedDataProvider prov(buffer.data(), buffer.size());
214
prevector_tester<8, int> test;
215
- while (prov.remaining_bytes()) {
216
+ while (--limit_max_ops >= 0 && prov.remaining_bytes()) {
217
switch (prov.ConsumeIntegralInRange<int>(0, 13 + 3 * (test.size() > 0))) {
218
case 0:
219
test.insert(prov.ConsumeIntegralInRange<size_t>(0, test.size()), prov.ConsumeIntegral<int>());
0 commit comments