Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98947417 authored by Steven Moreland's avatar Steven Moreland
Browse files

binder_parcel_fuzzer: avoid timeouts

libFuzzer was causing this test to timeout by feeding it, say, 600kb of
input, corresponding to 150,000 instructions to run. This kind of input
isn't interesting and is distracting from real results, so artificially
cutting the maximum input size to 50kb (~ 17,500 instructions).

Fixes: 142617274
Test: binder_parcel_fuzzer
Change-Id: I320ec57a9d1827ecaec035a3b5414bc4f97c0620
parent e676761d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -74,6 +74,10 @@ void fuzz(uint8_t options, const std::vector<uint8_t>& input, const std::vector<

extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
    if (size <= 1) return 0;  // no use

    // avoid timeouts, see b/142617274, b/142473153
    if (size > 50000) return 0;

    uint8_t options = *data;
    data++;
    size--;