diff --git a/bin/oss-fuzz-setup.sh b/bin/oss-fuzz-setup.sh index abdcfde0e63a..e9a1b02f753b 100755 --- a/bin/oss-fuzz-setup.sh +++ b/bin/oss-fuzz-setup.sh @@ -95,15 +95,17 @@ curl --no-progress-meter -S \ -C - -O https://raw.githubusercontent.com/google/fuzzing/master/dictionaries/webp.dict \ -C - -O https://raw.githubusercontent.com/google/fuzzing/master/dictionaries/zip.dict \ -C - -O https://raw.githubusercontent.com/google/fuzzing/master/dictionaries/mathml.dict +# upstream rtf.dict has an unescaped \h on line 90 that libFuzzer's ParseDictionaryFile rejects +sed -i '/"\\headerr"/d' rtf.dict # build our own fuzz dict for odf, following the pattern of svg.dict echo "# Keywords taken from libreoffice/schema/odf1.3/OpenDocument-v1.3-schema.rng" > odf.dict echo "# and libreoffice/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng" >> odf.dict echo "# tags" >> odf.dict -grep -h "rng:element name=" libreoffice/schema/odf1.3/OpenDocument-v1.3-schema.rng libreoffice/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng | sed 's#]*$##' >> odf.dict +grep -h "rng:element name=" libreoffice/schema/odf1.3/OpenDocument-v1.3-schema.rng libreoffice/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng | sed -n 's#.*> odf.dict echo "# attributes " >> odf.dict -grep -h "rng:attribute name=" libreoffice/schema/odf1.3/OpenDocument-v1.3-schema.rng libreoffice/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng | sed 's#]*$##' >> odf.dict +grep -h "rng:attribute name=" libreoffice/schema/odf1.3/OpenDocument-v1.3-schema.rng libreoffice/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng | sed -n 's#.*> odf.dict echo "# attributes' values" >> odf.dict -grep -h "rng:value" libreoffice/schema/odf1.3/OpenDocument-v1.3-schema.rng libreoffice/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng | sed 's##"#;s##"#;s#^[[:blank:]]*##;s#[[:blank:]>]*$##' | sort | uniq >> odf.dict +grep -h "rng:value" libreoffice/schema/odf1.3/OpenDocument-v1.3-schema.rng libreoffice/schema/libreoffice/OpenDocument-v1.4+libreoffice-schema.rng | sed -n 's#.*\([^<]*\).*#"\1"#p' | sort | uniq >> odf.dict #fuzzing corpuses #afl jpeg, gif, bmp, png, webp