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
--- 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;