[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Aug 2 08:14:22 UTC 2018


 sw/source/core/unocore/unoframe.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 0327615ca7df3de463c9773b1284e5089b7e481a
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Aug 1 20:11:08 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Aug 2 10:13:52 2018 +0200

    forcepoint#67 null deref
    
    Change-Id: I666c6b1795e037d3bb74d4ccc33be0e161bfb157
    Reviewed-on: https://gerrit.libreoffice.org/58444
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index b193f8ed757d..c3d409e02fec 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -3181,12 +3181,14 @@ uno::Reference< text::XTextCursor >  SwXTextFrame::createTextCursor()
 uno::Reference< text::XTextCursor >  SwXTextFrame::createTextCursorByRange(const uno::Reference< text::XTextRange > & aTextPosition)
 {
     SolarMutexGuard aGuard;
-    uno::Reference< text::XTextCursor >  aRef;
     SwFrameFormat* pFormat = GetFrameFormat();
+    if (!pFormat)
+        throw uno::RuntimeException();
     SwUnoInternalPaM aPam(*GetDoc());
-    if (!pFormat || !::sw::XTextRangeToSwPaM(aPam, aTextPosition))
+    if (!::sw::XTextRangeToSwPaM(aPam, aTextPosition))
         throw uno::RuntimeException();
 
+    uno::Reference<text::XTextCursor>  aRef;
     SwNode& rNode = pFormat->GetContent().GetContentIdx()->GetNode();
     if(aPam.GetNode().FindFlyStartNode() == rNode.FindFlyStartNode())
     {


More information about the Libreoffice-commits mailing list