[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Nov 25 13:55:27 UTC 2020


 sw/source/core/text/redlnitr.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit f9ba4668d857e8d3576d11c2d64317a4e42081d4
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Nov 25 10:10:56 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Nov 25 14:54:51 2020 +0100

    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/+/106522
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

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)


More information about the Libreoffice-commits mailing list