# HG changeset patch # User Augie Fackler # Date 2019-01-22 16:41:09 # Node ID 44cd432aed9f8f75e62a7aeb5c0a116f972b3088 # Parent ebe51a2e75be64f23c459f51be28d707750aeb32 fuzz: restrict manifest input size Again, let's keep the fuzzer from getting excited about huge inputs. Differential Revision: https://phab.mercurial-scm.org/D5642 diff --git a/contrib/fuzz/manifest.cc b/contrib/fuzz/manifest.cc --- a/contrib/fuzz/manifest.cc +++ b/contrib/fuzz/manifest.cc @@ -39,6 +39,11 @@ except Exception as e: 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; + } PyObject *mtext = PyBytes_FromStringAndSize((const char *)Data, (Py_ssize_t)Size); PyObject *locals = PyDict_New();