[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Sep 20 12:11:29 UTC 2018


 sw/source/filter/xml/xmlexp.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit 7d703f00ed94b0d6ea44132896f1926fb68c1c04
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Wed Sep 12 21:37:43 2018 +0200
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Thu Sep 20 14:11:05 2018 +0200

    tdf#108402: avoid crash if filter doesn't match
    
    See bt https://bugs.documentfoundation.org/attachment.cgi?id=134006
    + display warning
    
    Change-Id: I38496364c0965015ea54f753f3d3550f317d88d8
    Reviewed-on: https://gerrit.libreoffice.org/60413
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>
    (cherry picked from commit 475ea37809b5bec369d02a5ab500fac46ab40f0a)
    Reviewed-on: https://gerrit.libreoffice.org/60791
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>

diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 8a7da0693df1..eb13bc3db732 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -125,6 +125,8 @@ ErrCode SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
     }
 
     SwDoc *pDoc = getDoc();
+    if (!pDoc)
+        return ERR_SWG_WRITE_ERROR;
 
     // Make sure the layout is available to have more stability in the output
     // markup.
@@ -515,6 +517,12 @@ SwDoc* SwXMLExport::getDoc()
     if( m_pDoc != nullptr )
         return m_pDoc;
     Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
+    if (!xTextDoc)
+    {
+        SAL_WARN("sw.filter", "Problem of mismatching filter for export.");
+        return nullptr;
+    }
+
     Reference < XText > xText = xTextDoc->getText();
     Reference<XUnoTunnel> xTextTunnel( xText, UNO_QUERY);
     assert( xTextTunnel.is());


More information about the Libreoffice-commits mailing list