summaryrefslogtreecommitdiffstats
path: root/sot/source/sdstor/stgdir.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sot/source/sdstor/stgdir.cxx')
-rw-r--r--sot/source/sdstor/stgdir.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 7bdade90a935..e34e2d53dd24 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -825,6 +825,17 @@ void StgDirStrm::SetupEntry( sal_Int32 n, StgDirEntry* pUpper )
return;
}
+ if (pUpper)
+ {
+ StgDirEntry *pUpperUpper = pUpper->pUp;
+ if (pUpperUpper && pUpperUpper->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");
+ delete pCur;
+ return;
+ }
+ }
+
if( StgAvlNode::Insert
( (StgAvlNode**) ( pUpper ? &pUpper->pDown : &pRoot ), pCur ) )
{