sc/source/filter/excel/xiescher.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
New commits: commit 2f4684ac3950fe34d234a5c2334000af9396fec4 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sat Apr 10 12:50:59 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun Apr 11 15:30:46 2021 +0200 cid#1473782 silence Untrusted loop bound Change-Id: I5c6bd57f2ffbce4a8adf794c46aeb62cae5c6604 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113947 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 1a5ce0638e60..231f0097148c 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -4256,8 +4256,14 @@ void XclImpSheetDrawing::ReadNote3( XclImpStream& rStrm ) sal_uInt16 nPartLen = ::std::min( nTotalLen, static_cast< sal_uInt16 >( rStrm.GetRecLeft() ) ); OUStringBuffer aNoteText = rStrm.ReadRawByteString( nPartLen ); nTotalLen = nTotalLen - nPartLen; - while( (nTotalLen > 0) && (rStrm.GetNextRecId() == EXC_ID_NOTE) && rStrm.StartNextRecord() ) + while (true) { + if (!nTotalLen) + break; + if (rStrm.GetNextRecId() != EXC_ID_NOTE) + break; + if (!rStrm.StartNextRecord()) + break; rStrm >> aXclPos; nPartLen = rStrm.ReaduInt16(); OSL_ENSURE( aXclPos.mnRow == 0xFFFF, "XclImpObjectManager::ReadNote3 - missing continuation NOTE record" ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits