[Libreoffice-commits] core.git: sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 31 19:07:03 UTC 2021


 sc/source/filter/excel/xistream.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 741c72e00ed3d647121ce385c0f9442ecebb6216
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Mar 30 10:37:50 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Mar 31 21:06:16 2021 +0200

    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 at redhat.com>

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;


More information about the Libreoffice-commits mailing list