add corpora for more formats (#511)

* add sdc corpus

* add wps corpus

* add Acta corpus

* add bmi corpus

* add lrf corpus
This commit is contained in:
David Tardon 2017-04-04 22:55:53 +02:00 committed by Abhishek Arya
parent 361ceaece1
commit 41e114e0ce
2 changed files with 54 additions and 3 deletions

View File

@ -20,8 +20,8 @@ MAINTAINER dtardon@redhat.com
RUN apt-get update
RUN apt-get build-dep -y \
libmspub librevenge libcdr libvisio libpagemaker libfreehand libwpd \
libwpg
RUN apt-get install -y liblzma-dev libpng-dev wget
libwpg libwps libmwaw libe-book
RUN apt-get install -y liblzma-dev libpng-dev wget liblangtag-dev
ADD https://dev-www.libreoffice.org/src/lcms2-2.8.tar.gz $SRC/
# download fuzzing corpora
ADD https://dev-www.libreoffice.org/corpus/olefuzzer_seed_corpus.zip \
@ -33,10 +33,15 @@ ADD https://dev-www.libreoffice.org/corpus/olefuzzer_seed_corpus.zip \
https://dev-www.libreoffice.org/corpus/pmdfuzzer_seed_corpus.zip \
https://dev-www.libreoffice.org/corpus/fhfuzzer_seed_corpus.zip \
https://dev-www.libreoffice.org/corpus/cmxfuzzer_seed_corpus.zip \
https://dev-www.libreoffice.org/corpus/sdcfuzzer_seed_corpus.zip \
https://dev-www.libreoffice.org/corpus/bmifuzzer_seed_corpus.zip \
$SRC/
RUN wget \
https://sourceforge.net/projects/libwpd/files/corpus/wpdfuzzer_seed_corpus.zip \
https://sourceforge.net/projects/libwpg/files/corpus/wpgfuzzer_seed_corpus.zip \
https://sourceforge.net/projects/libwps/files/corpus/wpsfuzzer_seed_corpus.zip \
https://sourceforge.net/projects/libmwaw/files/corpus/actafuzzer_seed_corpus.zip \
https://sourceforge.net/projects/libebook/files/corpus/lrffuzzer_seed_corpus.zip \
-P $SRC
# clone sources
RUN git clone --depth 1 git://git.code.sf.net/p/libwpd/librevenge
@ -48,5 +53,9 @@ RUN git clone --depth 1 git://gerrit.libreoffice.org/libpagemaker
RUN git clone --depth 1 git://gerrit.libreoffice.org/libfreehand
RUN git clone --depth 1 git://git.code.sf.net/p/libwpd/code libwpd
RUN git clone --depth 1 git://git.code.sf.net/p/libwpg/code libwpg
RUN git clone --depth 1 https://github.com/fosnola/libstaroffice
RUN git clone --depth 1 git://git.code.sf.net/p/libwps/code libwps
RUN git clone --depth 1 git://git.code.sf.net/p/libmwaw/libmwaw
RUN git clone --depth 1 git://git.code.sf.net/p/libebook/code libe-book
WORKDIR $SRC
COPY build.sh $SRC/

View File

@ -15,13 +15,17 @@
#
################################################################################
# HACK to force linking with static icu and libxml2
# HACK to force linking with static icu, libxml2 and liblangtag
# WTH is liblangtag linked with glib?!
mkdir static
cp -pL \
/usr/lib/*/libicu*.a \
/usr/lib/*/libxml2.a \
/usr/lib/*/liblzma.a \
/usr/lib/*/libpng*.a \
/usr/lib/*/liblangtag.a \
/usr/lib/*/libglib-2.0.a \
/usr/lib/*/libpcre.a \
static
staticlib=$(pwd)/static
@ -126,5 +130,43 @@ pushd libwpg
make -j$(nproc)
popd
pushd libstaroffice
./autogen.sh
./configure --without-docs --disable-shared --enable-static --disable-tools --enable-fuzzers \
REVENGE_CFLAGS=-I$rvnginc REVENGE_LIBS="-L$rvnglib -lrevenge-0.0" \
REVENGE_STREAM_CFLAGS=-I$rvnginc REVENGE_STREAM_LIBS="-L$rvnglib -lrevenge-stream-0.0" \
REVENGE_GENERATORS_CFLAGS=-I$rvnginc REVENGE_GENERATORS_LIBS="-L$rvnglib -lrevenge-generators-0.0"
make -j$(nproc)
popd
pushd libwps
./autogen.sh
./configure --without-docs --disable-shared --enable-static --disable-tools --enable-fuzzers \
REVENGE_CFLAGS=-I$rvnginc REVENGE_LIBS="-L$rvnglib -lrevenge-0.0" \
REVENGE_STREAM_CFLAGS=-I$rvnginc REVENGE_STREAM_LIBS="-L$rvnglib -lrevenge-stream-0.0" \
REVENGE_GENERATORS_CFLAGS=-I$rvnginc REVENGE_GENERATORS_LIBS="-L$rvnglib -lrevenge-generators-0.0"
make -j$(nproc)
popd
pushd libmwaw
./autogen.sh
./configure --without-docs --disable-shared --enable-static --disable-tools --disable-zip --enable-fuzzers \
REVENGE_CFLAGS=-I$rvnginc REVENGE_LIBS="-L$rvnglib -lrevenge-0.0 -lrevenge-stream-0.0" \
REVENGE_GENERATORS_CFLAGS=-I$rvnginc REVENGE_GENERATORS_LIBS="-L$rvnglib -lrevenge-generators-0.0"
make -j$(nproc)
popd
pushd libe-book
./autogen.sh
./configure --without-docs --disable-shared --enable-static --disable-tools --enable-fuzzers \
LDFLAGS=-L$staticlib \
XML_LIBS="-lxml2 -llzma" \
LANGTAG_LIBS="-llangtag -lglib-2.0 -lpcre" \
REVENGE_CFLAGS=-I$rvnginc REVENGE_LIBS="-L$rvnglib -lrevenge-0.0" \
REVENGE_STREAM_CFLAGS=-I$rvnginc REVENGE_STREAM_LIBS="-L$rvnglib -lrevenge-stream-0.0" \
REVENGE_GENERATORS_CFLAGS=-I$rvnginc REVENGE_GENERATORS_LIBS="-L$rvnglib -lrevenge-generators-0.0"
make -j$(nproc)
popd
cp */src/fuzz/*fuzzer $OUT
cp *_seed_corpus.zip $OUT