D5642: fuzz: restrict manifest input size

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Jan 23 00:46:13 EST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG44cd432aed9f: fuzz: restrict manifest input size (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5642?vs=13338&id=13355

REVISION DETAIL
  https://phab.mercurial-scm.org/D5642

AFFECTED FILES
  contrib/fuzz/manifest.cc

CHANGE DETAILS

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 @@
 
 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();



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list