summaryrefslogtreecommitdiff
path: root/sot/source
diff options
context:
space:
mode:
authorWei Ming Khoo <wmk26@cam.ac.uk>2012-02-29 13:01:35 +0000
committerCaolán McNamara <caolanm@redhat.com>2012-02-29 13:05:04 +0000
commit0a9ced485fb712ce0d03fb20be1df6067606e11c (patch)
treecfa9711b921d3fc89630a817950d18c82e65970d /sot/source
parent1a2a2a02bd03829d2d50fb5f1a2178280ed2e997 (diff)
fix storage chain loop
Diffstat (limited to 'sot/source')
-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 ) )
{