sw/source/filter/xml/xmlimp.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 97eaf03625d5a0b8d3340b5495143d08a9707275
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Jun 16 10:46:22 2023 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Fri Jun 16 17:33:26 2023 +0200

    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.mcnam...@collabora.com>

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());

Reply via email to