diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-08-03 20:53:02 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-08-03 20:53:02 +0100 |
commit | cd6c9aef7468120dd5ea5c747f35c98baf214613 (patch) | |
tree | e6348725b5ce88ea399b41443efade7dc9947105 /sw/source | |
parent | cd47929a6d161a99fb89bc91e776895ca2054b88 (diff) |
check that dest index is in doc range
Change-Id: I3006cf03cf97399a6c418162178acdb1d41c3b23
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/basflt/fltshell.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index 7e4da738ba2d..2dae68cd4be8 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -138,7 +138,11 @@ bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, bool bCheck, rRegion.SetMark(); if (rMkPos.m_nNode != rPtPos.m_nNode) { - rRegion.GetPoint()->nNode = rPtPos.m_nNode.GetIndex() + 1; + sal_uLong n = rPtPos.m_nNode.GetIndex() + 1; + SwNodes& rNodes = rRegion.GetPoint()->nNode.GetNodes(); + if (n >= rNodes.Count()) + return false; + rRegion.GetPoint()->nNode = n; pCNd = GetContentNode(pDoc, rRegion.GetPoint()->nNode, false); } rRegion.GetPoint()->nContent.Assign(pCNd, rPtPos.m_nContent); |