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:13:12 +0200
commit6e77dcd9d2605e55b57d0a379d87cdd2c48b62f4 (patch)
tree07b009ed07e44081f00ea1bfcbe76ae32d9686e0 /lotuswordpro
parentddd9b1bccd87c6913ba4576da8af2d59daf106e9 (diff)
ofz#23300 infinite loop
Change-Id: I0ee67e8efefa48942357340cae46bd7ece27e5b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96085 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 e21505d06420..3321f294469e 100644
--- a/lotuswordpro/source/filter/lwprowlayout.cxx
+++ b/lotuswordpro/source/filter/lwprowlayout.cxx
@@ -404,7 +404,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);