summaryrefslogtreecommitdiff
path: root/sc/source/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-03-30 10:37:50 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-03-31 21:06:16 +0200
commit741c72e00ed3d647121ce385c0f9442ecebb6216 (patch)
tree3858889e3160c17b1956e1fa580b8638cb2ac0fc /sc/source/filter
parent441342654e5b4c61317b9a596396a1d817dd8547 (diff)
cid#1242892 silence Untrusted loop bound
Change-Id: If7d1106e8cc5a5f5767df8ae6bfb6b1bfdb28f82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113401 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/filter')
-rw-r--r--sc/source/filter/excel/xistream.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx
index f5f82e5176ff..e1126aaf2950 100644
--- a/sc/source/filter/excel/xistream.cxx
+++ b/sc/source/filter/excel/xistream.cxx
@@ -797,8 +797,10 @@ void XclImpStream::Ignore( std::size_t nBytes )
{
// implementation similar to Read(), but without really reading anything
std::size_t nBytesLeft = nBytes;
- while( mbValid && (nBytesLeft > 0) )
+ while (mbValid)
{
+ if (!nBytesLeft)
+ break;
sal_uInt16 nReadSize = GetMaxRawReadSize( nBytesLeft );
mbValid = checkSeek(mrStrm, mrStrm.Tell() + nReadSize);
mnRawRecLeft = mnRawRecLeft - nReadSize;