# HG changeset patch # User Augie Fackler # Date 2019-01-22 16:18:05 # Node ID afc33a5705b992c9a0a5de9cf7d7c298b8a5b92d # Parent a322dbee4edaea65d3c2aed9a30ca972e435a028 fuzz: don't allow enormous revlog inputs either I'm about to make the fuzzer do more, and without this it was getting enthusiastic about large (and therefore slow) inputs that I don't think buy us much. Differential Revision: https://phab.mercurial-scm.org/D5640 diff --git a/contrib/fuzz/revlog.cc b/contrib/fuzz/revlog.cc --- a/contrib/fuzz/revlog.cc +++ b/contrib/fuzz/revlog.cc @@ -31,6 +31,11 @@ for inline in (True, False): int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { + // Don't allow fuzzer inputs larger than 60k, since we'll just bog + // down and not accomplish much. + if (Size > 60000) { + return 0; + } PyObject *text = PyBytes_FromStringAndSize((const char *)Data, (Py_ssize_t)Size); PyObject *locals = PyDict_New();