add abw corpus (#515)

This commit is contained in:
David Tardon 2017-04-05 16:45:17 +02:00 committed by Abhishek Arya
parent 26d50f18fc
commit 76bd4a5443
4 changed files with 214 additions and 2 deletions

View File

@ -20,7 +20,7 @@ MAINTAINER dtardon@redhat.com
RUN apt-get update
RUN apt-get build-dep -y \
libmspub librevenge libcdr libvisio libpagemaker libfreehand libwpd \
libwpg libwps libmwaw libe-book
libwpg libwps libmwaw libe-book libabw
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
@ -35,6 +35,7 @@ ADD https://dev-www.libreoffice.org/corpus/olefuzzer_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 \
https://dev-www.libreoffice.org/corpus/abwfuzzer_seed_corpus.zip \
$SRC/
RUN wget \
https://sourceforge.net/projects/libwpd/files/corpus/wpdfuzzer_seed_corpus.zip \
@ -57,5 +58,6 @@ 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
RUN git clone --depth 1 git://gerrit.libreoffice.org/libabw
WORKDIR $SRC
COPY build.sh $SRC/
COPY build.sh abw.dict *.options $SRC/

195
projects/dlplibs/abw.dict Normal file
View File

@ -0,0 +1,195 @@
#
# AFL dictionary for XML
# ----------------------
#
# Several basic syntax elements and attributes, modeled on libxml2.
#
# Created by Michal Zalewski <lcamtuf@google.com>
#
attr_encoding=" encoding=\"1\""
attr_generic=" a=\"1\""
attr_href=" href=\"1\""
attr_standalone=" standalone=\"no\""
attr_version=" version=\"1\""
attr_xml_base=" xml:base=\"1\""
attr_xml_id=" xml:id=\"1\""
attr_xml_lang=" xml:lang=\"1\""
attr_xml_space=" xml:space=\"1\""
attr_xmlns=" xmlns=\"1\""
entity_builtin="&lt;"
entity_decimal="&#1;"
entity_external="&a;"
entity_hex="&#x1;"
# keywords
"ANY"
"ATTLIST"
"CDATA"
"DOCTYPE"
"ELEMENT"
"EMPTY"
"ENTITIES"
"ENTITY"
"FIXED"
"ID"
"IDREF"
"IDREFS"
"IGNORE"
"IMPLIED"
"INCLUDE"
"NDATA"
"NMTOKEN"
"NMTOKENS"
"NOTATION"
"PCDATA"
"PUBLIC"
"REQUIRED"
"SYSTEM"
# Various tag parts
"<"
">"
"/>"
"</"
"<?"
"?>"
"<!"
"!>"
"[]"
"]]"
"<![CDATA["
"<![CDATA[]]>"
"\"\""
"''"
"=\"\""
"=''"
# DTD
"<!ATTLIST"
"<!DOCTYPE"
"<!ELEMENT"
"<!ENTITY"
"<![IGNORE["
"<![INCLUDE["
"<!NOTATION"
"#CDATA"
"#FIXED"
"#IMPLIED"
"#PCDATA"
"#REQUIRED"
# Encodings
"ISO-8859-1"
"US-ASCII"
"UTF-8"
"UTF-16"
"UTF-16BE"
"UTF-16LE"
# Namespaces and schemas
"xmlns"
"xmlns:"
"xmlns:xhtml=\"http://www.w3.org/1999/xhtml\""
"xmlns:xml=\"http://www.w3.org/XML/1998/namespace\""
"xmlns:xmlns=\"http://www.w3.org/2000/xmlns\""
"xmlns:awml=\"http://www.abisource.com/awml.dtd\""
string_col_fallback=":fallback"
string_col_generic=":a"
string_col_include=":include"
string_dashes="--"
string_parentheses="()"
string_percent="%a"
string_schema=":schema"
string_ucs4="UCS-4"
tag_close="</a>"
tag_open="<a>"
tag_open_close="<a />"
# Tag names
"a"
"abiword"
"awml"
"bookmark"
"br"
"c"
"cbr"
"cell"
"d"
"data"
"endnote"
"f"
"field"
"foot"
"frame"
"history"
"i"
"ignoredwords"
"image"
"iw"
"l"
"lists"
"m"
"metadata"
"p"
"pagesize"
"pbr"
"revisions"
"s"
"section"
"styles"
"table"
"version"
# Document properties
"document-endnote-initial"
"document-endnote-place-enddoc"
"document-endnote-place-endsection"
"document-endnote-restart-section"
"document-endnote-type"
"document-footnote-initial"
"document-footnote-restart-page"
"document-footnote-restart-section"
"document-footnote-type"
"dom-dir"
"lang"
"ltr"
"numeric"
"rtl"
# Para style properties
"ascent"
"descent"
"display"
"height"
"homogeneous"
"inline"
"list-style"
"width"
# Text style properties
"bgcolor"
"color"
"font-family"
"font-size"
"font-stretch"
"font-style"
"font-variant"
"font-weight"
"left"
"line-height"
"margin-bottom"
"margin-left"
"margin-right"
"margin-top"
"none"
"normal"
"right"
"text-align"
"text-decoration"
"text-indent"
"text-position"
"transparent"
"widows"

View File

@ -0,0 +1,2 @@
[libfuzzer]
dict = abw.dict

View File

@ -168,5 +168,18 @@ pushd libe-book
make -j$(nproc)
popd
pushd libabw
./autogen.sh
./configure --without-docs --disable-shared --enable-static --disable-tools --enable-fuzzers \
LDFLAGS=-L$staticlib \
LIBXML_LIBS="-lxml2 -llzma -licuuc -licudata" \
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
cp *.options $OUT
cp *.dict $OUT