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

Caolán McNamara caolanm at redhat.com
Sat Aug 22 07:10:16 PDT 2015


 sw/qa/core/data/ww6/pass/crash-6.doc |binary
 sw/source/filter/basflt/fltshell.cxx |    7 +++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 3230c8cf1cf2dc486f038d369e7f4f44ffd6b0a7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Aug 22 10:31:35 2015 +0100

    check that src index is in doc range
    
    Change-Id: Ic81e7a14701ff30aa46a9293dd6db351bd350ba5

diff --git a/sw/qa/core/data/ww6/pass/crash-6.doc b/sw/qa/core/data/ww6/pass/crash-6.doc
new file mode 100644
index 0000000..08c8791
Binary files /dev/null and b/sw/qa/core/data/ww6/pass/crash-6.doc differ
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index 2dae68c..6c722d3 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


More information about the Libreoffice-commits mailing list