diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2016-09-16 22:32:29 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-09-21 19:38:21 +0000 |
commit | 137e42521944c0f3d7ff73891917a476f2868996 (patch) | |
tree | 12b9e2731201d47e45d9fed9311e4b2e2a72ad40 /sw | |
parent | 16981dd39a59d77149cbe922eb3f9a8e8fd5c6a6 (diff) |
tdf#102233: avoid infinite loop recursion in IsProtect node method
See https://bugs.documentfoundation.org/show_bug.cgi?id=102233#c5
Change-Id: Ic985662011b33d4b20b7c60df33c9ecc97326e85
Reviewed-on: https://gerrit.libreoffice.org/28972
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit cd72269a6a2c85ae9dd4552aa4808ef4fd1f6c0e)
Reviewed-on: https://gerrit.libreoffice.org/29152
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/docnode/node.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 392143c44e96..4273fd0aa538 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -433,10 +433,14 @@ bool SwNode::IsProtect() const SwFrameFormat* pFlyFormat = GetFlyFormat(); if( pFlyFormat ) { - if( pFlyFormat->GetProtect().IsContentProtected() ) + if (pFlyFormat->GetProtect().IsContentProtected()) return true; const SwFormatAnchor& rAnchor = pFlyFormat->GetAnchor(); - return rAnchor.GetContentAnchor() && rAnchor.GetContentAnchor()->nNode.GetNode().IsProtect(); + const SwPosition* pAnchorPos = rAnchor.GetContentAnchor(); + if (!pAnchorPos) + return false; + const SwNode& rAnchorNd = pAnchorPos->nNode.GetNode(); + return &rAnchorNd != this && rAnchorNd.IsProtect(); } if( nullptr != ( pSttNd = FindFootnoteStartNode() ) ) |