summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-14 16:11:40 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-03-14 20:24:41 +0000
commit9e83222bb1bf18ebcfa354f958606677a63ab1d9 (patch)
tree7e52f4ff337a8b1e8d79e6ff02a01271410a207c /sot
parent69def929aa5b07e5a67279d5da20001c844fdf06 (diff)
check full chain upwards
Change-Id: I3a620824b987bf78eaabffa913a3a62a842ba0d9 Reviewed-on: https://gerrit.libreoffice.org/35193 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sot')
-rw-r--r--sot/qa/cppunit/data/pass/loop-1.compoundbin0 -> 3584 bytes
-rw-r--r--sot/source/sdstor/stgdir.cxx18
2 files changed, 6 insertions, 12 deletions
diff --git a/sot/qa/cppunit/data/pass/loop-1.compound b/sot/qa/cppunit/data/pass/loop-1.compound
new file mode 100644
index 000000000000..eddb9164c920
--- /dev/null
+++ b/sot/qa/cppunit/data/pass/loop-1.compound
Binary files differ
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index a4c682df3855..7d496223e29e 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -800,23 +800,17 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
if( nLeaf != 0 && nLeft != 0 && nRight != 0 )
{
- //fdo#41642 Do we need to check full chain upwards for loops ?
- if (pUpper)
+ //fdo#41642
+ StgDirEntry *pUp = pUpper;
+ while (pUp)
{
- if (pUpper->m_aEntry.GetLeaf(STG_CHILD) == nLeaf)
+ if (pUp->m_aEntry.GetLeaf(STG_CHILD) == nLeaf)
{
- OSL_FAIL("Leaf node of upper StgDirEntry is same as current StgDirEntry's leaf node. Circular entry chain, discarding link");
- delete pCur;
- return;
- }
-
- StgDirEntry *pUpperUpper = pUpper->m_pUp;
- if (pUpperUpper && pUpperUpper->m_aEntry.GetLeaf(STG_CHILD) == nLeaf)
- {
- OSL_FAIL("Leaf node of upper-upper StgDirEntry is same as current StgDirEntry's leaf node. Circular entry chain, discarding link");
+ SAL_WARN("sot", "Leaf node of upper StgDirEntry is same as current StgDirEntry's leaf node. Circular entry chain, discarding link");
delete pCur;
return;
}
+ pUp = pUp->m_pUp;
}
if( StgAvlNode::Insert