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>
This commit is contained in:
Luboš Luňák
2022-03-08 12:59:47 +01:00
parent d73551e402
commit d032b81bbf

View File

@@ -2695,7 +2695,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*) )