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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Aug 2 09:52:57 UTC 2018


 writerfilter/source/dmapper/DomainMapper_Impl.cxx |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 0845c1a74aef650b4aebaeea9587b3bfb5b38ffb
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Aug 1 09:04:58 2018 +0100
Commit:     Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Thu Aug 2 11:52:28 2018 +0200

    forcepoint#56 null deref
    
    Change-Id: Iaa9c4d6901a340145412fa46eaf5c292c3fb62e8
    Reviewed-on: https://gerrit.libreoffice.org/58387
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <Michael.Stahl at cib.de>

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 321866daf85a..3d02e14b6bed 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2896,15 +2896,17 @@ void DomainMapper_Impl::PushFieldContext()
     TagLogger::getInstance().element("pushFieldContext");
 #endif
 
-    uno::Reference< text::XTextAppend >  xTextAppend;
+    uno::Reference<text::XTextCursor> xCrsr;
     if (!m_aTextAppendStack.empty())
-        xTextAppend = m_aTextAppendStack.top().xTextAppend;
-    uno::Reference< text::XTextRange > xStart;
-    if (xTextAppend.is())
     {
-        uno::Reference< text::XTextCursor > xCrsr = xTextAppend->createTextCursorByRange( xTextAppend->getEnd() );
-        xStart = xCrsr->getStart();
+        uno::Reference<text::XTextAppend> xTextAppend = m_aTextAppendStack.top().xTextAppend;
+        if (xTextAppend.is())
+            xCrsr = xTextAppend->createTextCursorByRange(xTextAppend->getEnd());
     }
+
+    uno::Reference< text::XTextRange > xStart;
+    if (xCrsr.is())
+        xStart = xCrsr->getStart();
     m_aFieldStack.push( std::make_shared<FieldContext>( xStart ) );
 }
 /*-------------------------------------------------------------------------


More information about the Libreoffice-commits mailing list