diff --git a/contrib/fuzz/Makefile b/contrib/fuzz/Makefile --- a/contrib/fuzz/Makefile +++ b/contrib/fuzz/Makefile @@ -62,7 +62,7 @@ parsers-%.o: ../../mercurial/cext/%.c 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 \ 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", + ] + ), + )