From 05652e51420630310606ac29f86e76f3bb148af5 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 5 Nov 2018 12:28:23 +0000 Subject: ofz#11261 null-deref MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I2a6b17feb500be9b76f89ed3ae177f44f4c164ec Reviewed-on: https://gerrit.libreoffice.org/62896 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- xmloff/source/text/txtparai.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'xmloff') diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index 4b1ed3061456..562a7def9a69 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -639,6 +639,11 @@ void XMLImpRubyContext_Impl::EndElement() GetImport().GetTextImport()); const Reference < XTextCursor > xAttrCursor( xTextImport->GetText()->createTextCursorByRange( m_xStart )); + if (!xAttrCursor.is()) + { + SAL_WARN("xmloff.text", "cannot insert ruby"); + return; + } xAttrCursor->gotoRange(xTextImport->GetCursorAsRange()->getStart(), true); xTextImport->SetRuby( GetImport(), xAttrCursor, -- cgit