diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-11-25 10:10:56 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-11-25 12:51:01 +0100 |
commit | ac65359fe7d829f746699509decd6238f6a8f20d (patch) | |
tree | ecadc8bb7574fe1519d38e7672c0e8578f77b5d8 /sw | |
parent | 3a9c3c918a3efb0d2f8f40e79f7032124d17b6f5 (diff) |
crashtesting: null deref on load of ooo72915-2.odt
since...
commit aacaa2aa91f705d64b929b5cff2872f160021b9f
Date: Tue Nov 3 22:11:59 2020 +0100
sw_fieldmarkhide: let CheckParaRedlineMerge() hide fieldmarks
HideIterator finds the next delete redline or fieldmark, whichever is
closer.
Change-Id: Ibe4373255356d9fe235f787c5672e72ae7032f85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106578
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/text/redlnitr.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx index a79ce4878a89..3a6a2749f8a4 100644 --- a/sw/source/core/text/redlnitr.cxx +++ b/sw/source/core/text/redlnitr.cxx @@ -134,11 +134,12 @@ public: sal_Unicode const magic(m_eFieldmarkMode == sw::FieldmarkMode::ShowResult ? CH_TXT_ATR_FIELDSTART : CH_TXT_ATR_FIELDSEP); - sal_Int32 const nPos(m_pEndPos->nNode.GetNode().GetTextNode()->GetText().indexOf( - magic, m_pEndPos->nContent.GetIndex())); + SwTextNode* pTextNode = m_pEndPos->nNode.GetNode().GetTextNode(); + sal_Int32 const nPos = pTextNode ? pTextNode->GetText().indexOf( + magic, m_pEndPos->nContent.GetIndex()) : -1; if (nPos != -1) { - m_oNextFieldmarkHide.emplace(*m_pEndPos->nNode.GetNode().GetTextNode(), nPos); + m_oNextFieldmarkHide.emplace(*pTextNode, nPos); sw::mark::IFieldmark const*const pFieldmark( m_eFieldmarkMode == sw::FieldmarkMode::ShowResult ? m_rIDMA.getFieldmarkAt(*m_oNextFieldmarkHide) |