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

New commits:
commit ec79d0127f90d65d722e46688b6cfcf2f5e59794
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Aug 1 20:11:08 2018 +0100
Commit:     Michael Stahl <michael.st...@cib.de>
CommitDate: Fri Aug 3 11:16:04 2018 +0200

    forcepoint#67 null deref
    
    Change-Id: I666c6b1795e037d3bb74d4ccc33be0e161bfb157
    Reviewed-on: https://gerrit.libreoffice.org/58445
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>

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())
     {
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to