From d0404391e5f87a892c2eaed3a89028281af34f6b Mon Sep 17 00:00:00 2001 From: Frantisek Sumsal Date: Wed, 1 Nov 2023 20:18:28 +0100 Subject: [PATCH] fuzz: limit the size of the input To avoid timeouts in oss-fuzz. The timeout reported in #29736 happened with a ~500K test case, so with a conservative 128K limit we should still be well within a range for any reasonable-ish generated input to get through, while avoiding timeouts. Resolves: #29736 --- src/core/fuzz-execute-serialize.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/fuzz-execute-serialize.c b/src/core/fuzz-execute-serialize.c index 862b525974b..6069efd519f 100644 --- a/src/core/fuzz-execute-serialize.c +++ b/src/core/fuzz-execute-serialize.c @@ -75,6 +75,9 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { _cleanup_fclose_ FILE *f = NULL; _cleanup_fdset_free_ FDSet *fdset = NULL; + if (outside_size_range(size, 0, 128 * 1024)) + return 0; + fuzz_setup_logging(); assert_se(fdset = fdset_new()); -- 2.47.3