From ec79d0127f90d65d722e46688b6cfcf2f5e59794 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 1 Aug 2018 20:11:08 +0100 Subject: forcepoint#67 null deref Change-Id: I666c6b1795e037d3bb74d4ccc33be0e161bfb157 Reviewed-on: https://gerrit.libreoffice.org/58445 Tested-by: Jenkins Reviewed-by: Michael Stahl --- sw/source/core/unocore/unoframe.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sw') 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 aRef; SwNode& rNode = pFormat->GetContent().GetContentIdx()->GetNode(); if(aPam.GetNode().FindFlyStartNode() == rNode.FindFlyStartNode()) { -- cgit v1.2.3