bin/oss-fuzz-setup.sh              |    9 +++++++++
 vcl/workben/fodpfuzzer.options     |    2 +-
 vcl/workben/fodsfuzzer.options     |    2 +-
 vcl/workben/fodt2pdffuzzer.options |    2 +-
 vcl/workben/fodtfuzzer.options     |    2 +-
 5 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 6dc61f97cbd8333632e87155a8deaa5b7d45b60d
Author:     Caolán McNamara <[email protected]>
AuthorDate: Fri May 5 15:37:05 2023 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Fri May 5 16:41:13 2023 +0200

    build and use an odf fuzzing dictionary
    
    Change-Id: Ib6dabc636cd171151ce77e48a0e774e955ab7ce3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151434
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/bin/oss-fuzz-setup.sh b/bin/oss-fuzz-setup.sh
index 2787e46fa973..15c99fa0ab33 100755
--- a/bin/oss-fuzz-setup.sh
+++ b/bin/oss-fuzz-setup.sh
@@ -92,6 +92,15 @@ 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
+# 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 "# tags" >> odf.dict
+grep "rng:element name=" 
libreoffice/schema/odf1.3/OpenDocument-v1.3-schema.rng | sed 's#<rng:element 
name="#"<#;s#^[[:blank:]]*##;s#[[:blank:]>]*$##' >> odf.dict
+echo "# attributes " >> odf.dict
+grep "rng:attribute name=" 
libreoffice/schema/odf1.3/OpenDocument-v1.3-schema.rng | sed 's#<rng:attribute 
name="#"#;s#^[[:blank:]]*##;s#[[:blank:]>]*$##' >> odf.dict
+echo "# attributes' values" >> odf.dict
+grep "rng:value" libreoffice/schema/odf1.3/OpenDocument-v1.3-schema.rng | sed 
's#<rng:value>#"#;s#</rng:value>#"#;s#^[[:blank:]]*##;s#[[:blank:]>]*$##' | 
sort | uniq >> odf.dict
+
 #fuzzing corpuses
 #afl jpeg, gif, bmp, png, webp
 curl --no-progress-meter -S -C - -O 
https://lcamtuf.coredump.cx/afl/demo/afl_testcases.tgz
diff --git a/vcl/workben/fodpfuzzer.options b/vcl/workben/fodpfuzzer.options
index 76d308c39d0c..1d9660180c2a 100644
--- a/vcl/workben/fodpfuzzer.options
+++ b/vcl/workben/fodpfuzzer.options
@@ -1,3 +1,3 @@
 [libfuzzer]
 max_len = 65536
-dict = xml.dict
+dict = odf.dict
diff --git a/vcl/workben/fodsfuzzer.options b/vcl/workben/fodsfuzzer.options
index 76d308c39d0c..1d9660180c2a 100644
--- a/vcl/workben/fodsfuzzer.options
+++ b/vcl/workben/fodsfuzzer.options
@@ -1,3 +1,3 @@
 [libfuzzer]
 max_len = 65536
-dict = xml.dict
+dict = odf.dict
diff --git a/vcl/workben/fodt2pdffuzzer.options 
b/vcl/workben/fodt2pdffuzzer.options
index 1ae5aaff4b14..5419e88c7780 100644
--- a/vcl/workben/fodt2pdffuzzer.options
+++ b/vcl/workben/fodt2pdffuzzer.options
@@ -1,3 +1,3 @@
 [libfuzzer]
 max_len = 2048
-dict = xml.dict
+dict = odf.dict
diff --git a/vcl/workben/fodtfuzzer.options b/vcl/workben/fodtfuzzer.options
index 76d308c39d0c..1d9660180c2a 100644
--- a/vcl/workben/fodtfuzzer.options
+++ b/vcl/workben/fodtfuzzer.options
@@ -1,3 +1,3 @@
 [libfuzzer]
 max_len = 65536
-dict = xml.dict
+dict = odf.dict

Reply via email to