summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandy <randy408@protonmail.com>2020-02-13 16:43:36 +0100
committerAlbert Astals Cid <tsdgeos@yahoo.es>2020-02-13 20:54:39 +0000
commitbdc1caaeb22832a0dc1f7420a497cd2382d5edd6 (patch)
tree6c6ff7cc7b4eb0ed24d9dde169077d4d69af1ae5
parentcc41bfe79d2ab2f72a3a11ae1db946f7575e891a (diff)
ossfuzz: add dictionary, update build script
-rwxr-xr-xtest/ossfuzz.sh7
-rw-r--r--test/postscript.dict58
2 files changed, 63 insertions, 2 deletions
diff --git a/test/ossfuzz.sh b/test/ossfuzz.sh
index 885e18d..0ac9436 100755
--- a/test/ossfuzz.sh
+++ b/test/ossfuzz.sh
@@ -1,8 +1,6 @@
# This script is meant to be run by
# https://github.com/google/oss-fuzz/blob/master/projects/libspectre/Dockerfile
-wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs950/ghostscript-9.50.tar.gz
-tar xvzf ghostscript-9.50.tar.gz
cd ghostscript-9.50
./configure
make -j$(nproc) soinstall
@@ -18,3 +16,8 @@ $CXX $CXXFLAGS $SRC/libspectre/test/spectre_read_fuzzer.c -I. \
-o $OUT/spectre_read_fuzzer \
$LIB_FUZZING_ENGINE $SRC/libspectre/libspectre/.libs/libspectre.a \
$SRC/libspectre/ghostscript-9.50/bin/gs.a
+
+find $SRC/libspectre/ghostscript-9.50 -name "*.ps" | \
+ xargs zip $OUT/spectre_read_fuzzer_seed_corpus.zip
+
+cp $SRC/libspectre/test/postscript.dict $OUT/spectre_read_fuzzer.dict
diff --git a/test/postscript.dict b/test/postscript.dict
new file mode 100644
index 0000000..7ba2634
--- /dev/null
+++ b/test/postscript.dict
@@ -0,0 +1,58 @@
+#PostScript fuzzing dictionary made for fuzzing libspectre
+
+"%!PS-Adobe-"
+"EPSF-*"
+
+"%%"
+
+"%%BoundingBox:"
+"%%CreationDate:"
+"%%Creator:"
+"%%Orientation:"
+"%%Pages:"
+"%%PageOrder:"
+"%%Title:"
+"%%DocumentMedia:"
+"%%DocumentPaperSizes:"
+"%%EndComments"
+
+"%%BeginPreview"
+"%%EndPreview"
+
+"%%BeginDefaults"
+"%%PageBoundingBox:"
+"%%PageOrientation:"
+"%%PageMedia:"
+"%%EndDefaults"
+
+"%%BeginProlog"
+"%%EndProlog"
+
+"%%BeginSetup"
+"%%PageBoundingBox:"
+"%%PageOrientation:"
+"%%PaperSize:"
+"%%EndSetup"
+
+"%%Page:"
+"%%PageBoundingBox:"
+"%%PageOrientation:"
+"%%PageMedia:"
+"%%PaperSize:"
+
+"%%Trailer"
+"%%BoundingBox: "
+"%%Orientation:"
+"%%Pages:"
+"%%PageOrder:"
+"%%EOF"
+
+"(atend)"
+"atend"
+"Portrait"
+"Landscape"
+"Seascape"
+"UpsideDown"
+"Ascend"
+"Descend"
+"Special"