sc/source/filter/excel/impop.cxx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
New commits: commit 8ce77cbd706ffd60dfcd79d82779025ef8d6782c Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Fri Jun 11 11:06:11 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Jun 11 14:42:38 2021 +0200 cid#1473844 Untrusted loop bound and cid#1474351 Untrusted loop bound cid#1474118 Untrusted loop bound this time without second guessing the original intent Change-Id: Iaa6b636a08ed29feaf709fbcbac7deac761a0fc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117045 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx index 1c107d4ad092..988ec3fbf65e 100644 --- a/sc/source/filter/excel/impop.cxx +++ b/sc/source/filter/excel/impop.cxx @@ -878,8 +878,14 @@ void ImportExcel::Mulrk() XclAddress aXclPos; aIn >> aXclPos; - for( XclAddress aCurrXclPos( aXclPos ); (aXclPos.mnCol <= aCurrXclPos.mnCol) && (aIn.GetRecLeft() > 2); ++aCurrXclPos.mnCol ) + XclAddress aCurrXclPos(aXclPos); + while (true) { + if (aXclPos.mnCol > aCurrXclPos.mnCol) + break; + if (aIn.GetRecLeft() <= 2) + break; + sal_uInt16 nXF = aIn.ReaduInt16(); sal_Int32 nRkNum = aIn.ReadInt32(); @@ -889,6 +895,7 @@ void ImportExcel::Mulrk() GetXFRangeBuffer().SetXF( aScPos, nXF ); GetDocImport().setNumericCell(aScPos, XclTools::GetDoubleFromRK(nRkNum)); } + ++aCurrXclPos.mnCol; } } @@ -915,13 +922,20 @@ void ImportExcel::Mulblank() XclAddress aXclPos; aIn >> aXclPos; - for( XclAddress aCurrXclPos( aXclPos ); (aXclPos.mnCol <= aCurrXclPos.mnCol) && (aIn.GetRecLeft() > 2); ++aCurrXclPos.mnCol ) + XclAddress aCurrXclPos(aXclPos); + while (true) { + if (aXclPos.mnCol > aCurrXclPos.mnCol) + break; + if (aIn.GetRecLeft() <= 2) + break; + sal_uInt16 nXF = aIn.ReaduInt16(); ScAddress aScPos( ScAddress::UNINITIALIZED ); if( GetAddressConverter().ConvertAddress( aScPos, aCurrXclPos, GetCurrScTab(), true ) ) GetXFRangeBuffer().SetBlankXF( aScPos, nXF ); + ++aCurrXclPos.mnCol; } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits