From 0a9ced485fb712ce0d03fb20be1df6067606e11c Mon Sep 17 00:00:00 2001 From: Wei Ming Khoo Date: Wed, 29 Feb 2012 13:01:35 +0000 Subject: fix storage chain loop --- sot/qa/cppunit/data/pass/fdo41642-3.compound | Bin 0 -> 1252352 bytes sot/source/sdstor/stgdir.cxx | 11 +++++++++++ 2 files changed, 11 insertions(+) create mode 100644 sot/qa/cppunit/data/pass/fdo41642-3.compound diff --git a/sot/qa/cppunit/data/pass/fdo41642-3.compound b/sot/qa/cppunit/data/pass/fdo41642-3.compound new file mode 100644 index 000000000000..46a9e84d1def Binary files /dev/null and b/sot/qa/cppunit/data/pass/fdo41642-3.compound differ 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 ) ) { -- cgit