Kaydet (Commit) 3668960d authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz: infinite loop

Change-Id: Ie515421f484c63d07f10e8551464c7dc11facb73
Reviewed-on: https://gerrit.libreoffice.org/50001Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 5f0eacd7
......@@ -140,12 +140,18 @@ void LwpRowLayout::RegisterStyle()
LwpObjectID& rCellID= GetChildHead();
LwpCellLayout * pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get());
while(pCellLayout)
std::set<LwpCellLayout*> aSeen;
while (pCellLayout)
{
aSeen.insert(pCellLayout);
pCellLayout->SetFoundry(m_pFoundry);
pCellLayout->RegisterStyle();
rCellID = pCellLayout->GetNext();
pCellLayout = dynamic_cast<LwpCellLayout *>(rCellID.obj().get());
if (aSeen.find(pCellLayout) != aSeen.end())
throw std::runtime_error("loop in conversion");
}
}
......
......@@ -1121,14 +1121,18 @@ void LwpTableLayout::PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID)
LwpRowList* pRowList = dynamic_cast<LwpRowList*>(aRowListID.obj().get());
//loop the rowlist
while( nullptr!=pRowList)
std::set<LwpRowList*> aOuterSeen;
while (pRowList)
{
aOuterSeen.insert(pRowList);
sal_uInt16 nRowID = pRowList->GetRowID();
{
LwpCellList* pCellList = dynamic_cast<LwpCellList*>(pRowList->GetChildHeadID().obj().get());
//loop the cellList
while( nullptr!=pCellList)
std::set<LwpCellList*> aSeen;
while (pCellList)
{
aSeen.insert(pCellList);
{//put cell
sal_uInt16 nColID = pCellList->GetColumnID();
......@@ -1146,9 +1150,13 @@ void LwpTableLayout::PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID)
}
}
pCellList = dynamic_cast<LwpCellList*>(pCellList->GetNextID().obj().get());
if (aSeen.find(pCellList) != aSeen.end())
throw std::runtime_error("loop in conversion");
}
}
pRowList = dynamic_cast<LwpRowList*>(pRowList->GetNextID().obj().get());
if (aOuterSeen.find(pRowList) != aOuterSeen.end())
throw std::runtime_error("loop in conversion");
}
}catch (...) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment