[Libreoffice-commits] core.git: sc/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sun Apr 11 13:31:22 UTC 2021
sc/source/filter/excel/xiescher.cxx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 2f4684ac3950fe34d234a5c2334000af9396fec4
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Apr 10 12:50:59 2021 +0100
Commit: Caolán McNamara <caolanm at 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 <caolanm at 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" );
More information about the Libreoffice-commits
mailing list