[Libreoffice-commits] core.git: sw/source

Caolán McNamara caolanm at redhat.com
Mon Aug 3 12:55:37 PDT 2015


 sw/source/filter/basflt/fltshell.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit cd6c9aef7468120dd5ea5c747f35c98baf214613
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Aug 3 20:53:02 2015 +0100

    check that dest index is in doc range
    
    Change-Id: I3006cf03cf97399a6c418162178acdb1d41c3b23

diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index 7e4da73..2dae68c 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);


More information about the Libreoffice-commits mailing list