D7106: fuzz: restrict dirs fuzzer to only 40k of input
durin42 (Augie Fackler)
phabricator at mercurial-scm.org
Tue Oct 15 13:58:07 UTC 2019
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
Experimentally one very long path of this size shouldn't blow the RAM
budget in the fuzzer environment, and it's not really exciting to
discover that building the dirs dict for one stupidly long path uses a
ton of RAM.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D7106
AFFECTED FILES
contrib/fuzz/dirs.cc
CHANGE DETAILS
diff --git a/contrib/fuzz/dirs.cc b/contrib/fuzz/dirs.cc
--- a/contrib/fuzz/dirs.cc
+++ b/contrib/fuzz/dirs.cc
@@ -35,9 +35,10 @@
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) {
+ // Don't allow fuzzer inputs larger than 40k: the fuzzer will
+ // discover that if it passes us one extremely long path we'll
+ // use a ton of RAM, which is a surprise to nobody.
+ if (Size > 40000) {
return 0;
}
PyObject *mtext =
To: durin42, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list