summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-06-11 09:31:44 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-06-11 12:53:02 +0200
commit37d818a65429cde5b3eb6c5a1a95012894d039d7 (patch)
tree43d685021df1f100715ddaa76c9b2106b973d552 /lotuswordpro
parentdfadae15217465da0c39e363a9a549dd4ee01d1d (diff)
ofz#23300 infinite loop
Change-Id: I0ee67e8efefa48942357340cae46bd7ece27e5b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96098 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwprowlayout.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/lotuswordpro/source/filter/lwprowlayout.cxx b/lotuswordpro/source/filter/lwprowlayout.cxx
index 56ea0c98ce33..cb350f891fa1 100644
--- a/lotuswordpro/source/filter/lwprowlayout.cxx
+++ b/lotuswordpro/source/filter/lwprowlayout.cxx
@@ -406,7 +406,10 @@ void LwpRowLayout::ConvertCommonRow(rtl::Reference<XFTable> const & pXFTable, sa
auto nNumCols = pConnCell->GetNumcols();
if (!nNumCols)
throw std::runtime_error("loop in conversion");
- nCellEndCol = i + nNumCols - 1;
+ auto nNewEndCol = i + nNumCols - 1;
+ if (nNewEndCol > std::numeric_limits<sal_uInt8>::max())
+ throw std::range_error("column index too large");
+ nCellEndCol = nNewEndCol;
i = nCellEndCol;
}
xCell = pCellLayout->DoConvertCell(pTable->GetObjectID(),crowid,i);