summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-03-08 12:59:47 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2022-03-08 22:14:54 +0100
commita03b08319f24c4a8570941460b91678a151ba5a2 (patch)
tree918b7aea17421b9f6785f07777f63cbc9ed86aec /sc
parent83c8f90ec25135060291acdc4f9d67495f645815 (diff)
proper columns range check (tdf#147830)
Change-Id: Ib23bc3f194fa418035e7c70a4f3e1b682f9c46b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131181 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com> (cherry picked from commit d032b81bbf2ca87114d15749d74166d0ba414972) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131195 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/table3.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index d57f405111a8..deefa64ac345 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -3495,7 +3495,7 @@ bool ScTable::CreateExcelQuery(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow
if (bValid)
{
sal_uLong nVisible = 0;
- for ( nCol=nCol1; nCol<=nCol2; nCol++ )
+ for ( nCol=nCol1; nCol<=ClampToAllocatedColumns(nCol2); nCol++ )
nVisible += aCol[nCol].VisibleCount( nRow1+1, nRow2 );
if ( nVisible > SCSIZE_MAX / sizeof(void*) )