Kaydet (Commit) 73ed5840 authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Andras Timar

forcepoint #5 null deref

Change-Id: I95b67f98b7028d7ca7c4a9d1c15100e42d359816
Reviewed-on: https://gerrit.libreoffice.org/50243Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
(cherry picked from commit 6ba5fc85)
üst ce1578c3
...@@ -1528,9 +1528,14 @@ XMLImpSpanContext_Impl::XMLImpSpanContext_Impl( ...@@ -1528,9 +1528,14 @@ XMLImpSpanContext_Impl::XMLImpSpanContext_Impl(
XMLImpSpanContext_Impl::~XMLImpSpanContext_Impl() XMLImpSpanContext_Impl::~XMLImpSpanContext_Impl()
{ {
if( pHint ) if (!pHint)
pHint->SetEnd( GetImport().GetTextImport() return;
->GetCursorAsRange()->getStart() );
Reference<XTextRange> xCrsrRange(GetImport().GetTextImport()->GetCursorAsRange());
if (!xCrsrRange.is())
return; // Robust (defective file)
pHint->SetEnd(xCrsrRange->getStart());
} }
SvXMLImportContext *XMLImpSpanContext_Impl::CreateChildContext( SvXMLImportContext *XMLImpSpanContext_Impl::CreateChildContext(
...@@ -1926,7 +1931,7 @@ XMLParaContext::~XMLParaContext() ...@@ -1926,7 +1931,7 @@ XMLParaContext::~XMLParaContext()
GetImport().GetTextImport()); GetImport().GetTextImport());
Reference < XTextRange > xCrsrRange( xTxtImport->GetCursorAsRange() ); Reference < XTextRange > xCrsrRange( xTxtImport->GetCursorAsRange() );
if( !xCrsrRange.is() ) if( !xCrsrRange.is() )
return; // Robust (defect file) return; // Robust (defective file)
Reference < XTextRange > xEnd(xCrsrRange->getStart()); Reference < XTextRange > xEnd(xCrsrRange->getStart());
// if we have an id set for this paragraph, get a cursor for this // if we have an id set for this paragraph, get a cursor for this
...@@ -1952,7 +1957,7 @@ XMLParaContext::~XMLParaContext() ...@@ -1952,7 +1957,7 @@ XMLParaContext::~XMLParaContext()
try { try {
xAttrCursor = xTxtImport->GetText()->createTextCursorByRange( xStart ); xAttrCursor = xTxtImport->GetText()->createTextCursorByRange( xStart );
if( !xAttrCursor.is() ) if( !xAttrCursor.is() )
return; // Robust (defect file) return; // Robust (defective file)
} catch (const uno::Exception &) { } catch (const uno::Exception &) {
// createTextCursorByRange() likes to throw runtime exception, even // createTextCursorByRange() likes to throw runtime exception, even
// though it just means 'we were unable to create the cursor' // though it just means 'we were unable to create the cursor'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment