diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-08-22 10:31:35 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-08-22 15:09:45 +0100 |
commit | 3230c8cf1cf2dc486f038d369e7f4f44ffd6b0a7 (patch) | |
tree | dc1bd3b78e5fd0a4b2423fe4f49ddc876e33fd84 /sw | |
parent | 7e318570dc0c0878bfd2a960230a26f7e5fe2bcf (diff) |
check that src index is in doc range
Change-Id: Ic81e7a14701ff30aa46a9293dd6db351bd350ba5
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/core/data/ww6/pass/crash-6.doc | bin | 0 -> 6672 bytes | |||
-rw-r--r-- | sw/source/filter/basflt/fltshell.cxx | 7 |
2 files changed, 5 insertions, 2 deletions
diff --git a/sw/qa/core/data/ww6/pass/crash-6.doc b/sw/qa/core/data/ww6/pass/crash-6.doc Binary files differnew file mode 100644 index 000000000000..08c879176a47 --- /dev/null +++ b/sw/qa/core/data/ww6/pass/crash-6.doc 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 |