# HG changeset patch # User Augie Fackler # Date 1546961470 18000 # Node ID 2e60a77b7058cd4597913b13251c01c82d707ba9 # Parent 8ddc5d8bea2589a01a69d59dfcd246f6966501dc xdiff: don't attempt to use fuzzer inputs larger than 100k This is the recommended approach from [0], and limiting the input was suggested in https://github.com/google/oss-fuzz/issues/2076 when discussing our broken coverage build. 0: https://github.com/google/oss-fuzz/blob/master/docs/new_project_guide.md#custom-libfuzzer-options-for-clusterfuzz Differential Revision: https://phab.mercurial-scm.org/D5525 diff -r 8ddc5d8bea25 -r 2e60a77b7058 contrib/fuzz/xdiff.cc --- a/contrib/fuzz/xdiff.cc Tue Jan 08 17:52:39 2019 -0800 +++ b/contrib/fuzz/xdiff.cc Tue Jan 08 10:31:10 2019 -0500 @@ -22,6 +22,11 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { + // Don't allow fuzzer inputs larger than 100k, since we'll just bog + // down and not accomplish much. + if (Size > 100000) { + return 0; + } auto maybe_inputs = SplitInputs(Data, Size); if (!maybe_inputs) { return 0;