summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-06-16 10:46:22 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2023-06-16 17:33:26 +0200
commit97eaf03625d5a0b8d3340b5495143d08a9707275 (patch)
treebaad5ce7a245686d0de53cee4428a52f4b3f867c
parentaca32a55456aa4e907b216fb490b3c15d26c3d55 (diff)
ofz#59859 Timeout
an interesting finding, but we still want this fuzzer to generate documents that don't need tweaking to load in the normal office so enfore the xml detection rule Change-Id: Ie21f8f5d985b97068935fab6a6abfee8901b1b5e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153176 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r--sw/source/filter/xml/xmlimp.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 594cb893ca4c..43fe07ecff4a 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1790,7 +1790,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestPDFExportFODT(SvStream &rStream)
rStream.Seek(STREAM_SEEK_TO_BEGIN);
OUString resultString(str.getStr(), str.getLength(), RTL_TEXTENCODING_ASCII_US,
RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_DEFAULT|RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT|RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT);
- if (resultString.indexOf("office:mimetype=\"application/vnd.oasis.opendocument.text\"") == -1)
+ if (!resultString.startsWith("<?xml") || resultString.indexOf("office:mimetype=\"application/vnd.oasis.opendocument.text\"") == -1)
return false;
Reference<css::frame::XDesktop2> xDesktop = css::frame::Desktop::create(comphelper::getProcessComponentContext());