diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-19 14:40:15 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-19 21:44:54 +0100 |
commit | 1404b82e8d4fb9c809cfe478807d3831b2c924a0 (patch) | |
tree | 5e78d12b1f6fad165c37fd98d274c9c7833f233e /lotuswordpro | |
parent | 3668960d94d21ad215c2cbe02f95560416b0a9e3 (diff) |
ofz: infinite loop
Change-Id: I2230a3fdd602063e66f56d23c15f79d6d4de4c8a
Reviewed-on: https://gerrit.libreoffice.org/50000
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwptablelayout.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx index 81ee8213ff16..33a7b412efa7 100644 --- a/lotuswordpro/source/filter/lwptablelayout.cxx +++ b/lotuswordpro/source/filter/lwptablelayout.cxx @@ -451,8 +451,11 @@ void LwpTableLayout::TraverseTable() // set value LwpObjectID& rRowID = GetChildHead(); LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(rRowID.obj().get()); + std::set<LwpRowLayout*> aSeen; while (pRowLayout) { + aSeen.insert(pRowLayout); + pRowLayout->SetRowMap(); // for 's analysis job @@ -462,6 +465,8 @@ void LwpTableLayout::TraverseTable() rRowID = pRowLayout->GetNext(); pRowLayout = dynamic_cast<LwpRowLayout *>(rRowID.obj().get()); + if (aSeen.find(pRowLayout) != aSeen.end()) + throw std::runtime_error("loop in conversion"); } } @@ -563,8 +568,11 @@ void LwpTableLayout::RegisterColumns() // NOTICE: all default columns are regarded as justifiable columns LwpObjectID& rColumnID = GetColumnLayoutHead(); LwpColumnLayout * pColumnLayout = dynamic_cast<LwpColumnLayout *>(rColumnID.obj().get()); + std::set<LwpColumnLayout*> aSeen; while (pColumnLayout) { + aSeen.insert(pColumnLayout); + auto nColId = pColumnLayout->GetColumnID(); if (nColId >= nCols) { @@ -580,6 +588,9 @@ void LwpTableLayout::RegisterColumns() rColumnID = pColumnLayout->GetNext(); pColumnLayout = dynamic_cast<LwpColumnLayout *>(rColumnID.obj().get()); + + if (aSeen.find(pColumnLayout) != aSeen.end()) + throw std::runtime_error("loop in conversion"); } // if all columns are not justifiable, the rightmost column will be changed to justifiable |