diff options
author | Wei Ming Khoo <wmk26@cam.ac.uk> | 2012-02-29 13:01:35 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-02-29 13:05:04 +0000 |
commit | 0a9ced485fb712ce0d03fb20be1df6067606e11c (patch) | |
tree | cfa9711b921d3fc89630a817950d18c82e65970d /sot | |
parent | 1a2a2a02bd03829d2d50fb5f1a2178280ed2e997 (diff) |
fix storage chain loop
Diffstat (limited to 'sot')
-rw-r--r-- | sot/qa/cppunit/data/pass/fdo41642-3.compound | bin | 0 -> 1252352 bytes | |||
-rw-r--r-- | sot/source/sdstor/stgdir.cxx | 11 |
2 files changed, 11 insertions, 0 deletions
diff --git a/sot/qa/cppunit/data/pass/fdo41642-3.compound b/sot/qa/cppunit/data/pass/fdo41642-3.compound Binary files differnew file mode 100644 index 000000000000..46a9e84d1def --- /dev/null +++ b/sot/qa/cppunit/data/pass/fdo41642-3.compound 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 ) ) { |