D7600: fuzz: add a seed corpus for the dirs fuzzer

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Dec 11 06:55:29 EST 2019


Closed by commit rHGb7af8a02a304: fuzz: add a seed corpus for the dirs fuzzer (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7600?vs=18594&id=18608

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7600/new/

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

AFFECTED FILES
  contrib/fuzz/Makefile
  contrib/fuzz/dirs_corpus.py

CHANGE DETAILS

diff --git a/contrib/fuzz/dirs_corpus.py b/contrib/fuzz/dirs_corpus.py
new file mode 100644
--- /dev/null
+++ b/contrib/fuzz/dirs_corpus.py
@@ -0,0 +1,29 @@
+from __future__ import absolute_import, print_function
+
+import argparse
+import zipfile
+
+ap = argparse.ArgumentParser()
+ap.add_argument("out", metavar="some.zip", type=str, nargs=1)
+args = ap.parse_args()
+
+with zipfile.ZipFile(args.out[0], "w", zipfile.ZIP_STORED) as zf:
+    zf.writestr(
+        "greek-tree",
+        "\n".join(
+            [
+                "iota",
+                "A/mu",
+                "A/B/lambda",
+                "A/B/E/alpha",
+                "A/B/E/beta",
+                "A/D/gamma",
+                "A/D/G/pi",
+                "A/D/G/rho",
+                "A/D/G/tau",
+                "A/D/H/chi",
+                "A/D/H/omega",
+                "A/D/H/psi",
+            ]
+        ),
+    )
diff --git a/contrib/fuzz/Makefile b/contrib/fuzz/Makefile
--- a/contrib/fuzz/Makefile
+++ b/contrib/fuzz/Makefile
@@ -62,7 +62,7 @@
 
 PARSERS_OBJS=parsers-manifest.o parsers-charencode.o parsers-parsers.o parsers-dirs.o parsers-pathencode.o parsers-revlog.o
 
-dirs_fuzzer: dirs.cc pyutil.o $(PARSERS_OBJS)
+dirs_fuzzer: dirs.cc pyutil.o $(PARSERS_OBJS) $$OUT/dirs_fuzzer_seed_corpus.zip
 	$(CXX) $(CXXFLAGS) `$(PYTHON_CONFIG) --cflags` \
 	  -Wno-register -Wno-macro-redefined \
 	  -I../../mercurial dirs.cc \



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


More information about the Mercurial-devel mailing list