From 13d8dfdc21ac25f35ee3d8389851b1f9955c9578 Mon Sep 17 00:00:00 2001 From: Max Moroz Date: Sat, 5 Nov 2016 00:47:14 +0100 Subject: [PATCH] [nss] Use seed corpus from Mozilla's repository. (#68) --- targets/nss/Dockerfile | 1 + targets/nss/build.sh | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/targets/nss/Dockerfile b/targets/nss/Dockerfile index f018e5392..4b5ff0c15 100644 --- a/targets/nss/Dockerfile +++ b/targets/nss/Dockerfile @@ -20,5 +20,6 @@ RUN apt-get install -y make autoconf automake libtool mercurial zlib1g-dev RUN hg clone https://hg.mozilla.org/projects/nspr nspr RUN hg clone https://hg.mozilla.org/projects/nss nss +RUN git clone https://github.com/mozilla/nss-fuzzing-corpus.git nss-corpus COPY build.sh fuzzers/* /src/ diff --git a/targets/nss/build.sh b/targets/nss/build.sh index 60e951c6a..23c2bac35 100755 --- a/targets/nss/build.sh +++ b/targets/nss/build.sh @@ -59,3 +59,10 @@ for fuzzer in $FUZZERS; do /work/nss/lib/libnspr4.a /work/nss/lib/libplc4.a /work/nss/lib/libplds4.a \ /work/nss/lib/prlog2.o -o /out/$fuzzer $FUZZER_LDFLAGS done + +# Archive and copy to /out seed corpus if the build succeeded. +zip /work/nss/all_nss_seed_corpus.zip /src/nss-corpus/*/* + +for fuzzer in $FUZZERS; do + cp /work/nss/all_nss_seed_corpus.zip /out/${fuzzer}_seed_corpus.zip +done