fix oss-fuzz ParseDictionaryFile startup errors

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I86602ef5cdd86a9c98829e172cdc04f7c3db018c
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/3086
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
(cherry picked from commit 524d79c8f1f314f6df921da7e0093cd4a9a7c91e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/205572
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
This commit is contained in:
Caolán McNamara
2026-05-23 13:52:52 +02:00
committed by Xisco Fauli
parent af6e41b327
commit e494181c41
+5 -3
View File
@@ -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#<rng:element name="#"<#;s#^[[:blank:]]*##;s#[[:blank:]>]*$##' >> 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#.*<rng:element name="\([^"]*\)".*#"<\1"#p' >> 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#<rng:attribute name="#"#;s#^[[:blank:]]*##;s#[[:blank:]>]*$##' >> 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#.*<rng:attribute name="\([^"]*\)".*#"\1"#p' >> 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#<rng:value>#"#;s#</rng:value>#"#;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#.*<rng:value>\([^<]*\)</rng:value>.*#"\1"#p' | sort | uniq >> odf.dict
#fuzzing corpuses
#afl jpeg, gif, bmp, png, webp