summaryrefslogtreecommitdiff
path: root/sw/source/filter/basflt
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-08-22 10:31:35 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-08-22 15:09:45 +0100
commit3230c8cf1cf2dc486f038d369e7f4f44ffd6b0a7 (patch)
treedc1bd3b78e5fd0a4b2423fe4f49ddc876e33fd84 /sw/source/filter/basflt
parent7e318570dc0c0878bfd2a960230a26f7e5fe2bcf (diff)
check that src index is in doc range
Change-Id: Ic81e7a14701ff30aa46a9293dd6db351bd350ba5
Diffstat (limited to 'sw/source/filter/basflt')
-rw-r--r--sw/source/filter/basflt/fltshell.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index 2dae68cd4be8..6c722d3fc85c 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -120,8 +120,11 @@ bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, bool bCheck,
// The only position of 0x0D will not be able to make region in the old logic
// because it is beyond the length of para...need special consideration here.
- SwContentNode *const pContentNode(
- SwNodeIndex(rMkPos.m_nNode, +1).GetNode().GetContentNode());
+ sal_uLong nMk = rMkPos.m_nNode.GetIndex() + 1;
+ const SwNodes& rMkNodes = rMkPos.m_nNode.GetNodes();
+ if (nMk >= rMkNodes.Count())
+ return false;
+ SwContentNode *const pContentNode(rMkNodes[nMk]->GetContentNode());
if (rMkPos == rPtPos &&
((0 != rPtPos.m_nContent) || (pContentNode && (0 != pContentNode->Len())))
&& ( RES_TXTATR_FIELD != nWhich