sc/source/filter/excel/xiescher.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 32ad749a512b03e2d4588de667e397949cc51958
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Apr 9 21:05:15 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sat Apr 10 15:53:27 2021 +0200

    cid#1474380 silence Untrusted loop bound
    
    Change-Id: Ic162a5aeed4b422a8db5ff1bdd89c4e098ffa248
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113908
    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 599135666e47..1a5ce0638e60 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -1345,11 +1345,12 @@ void XclImpPolygonObj::ReadCoordList( XclImpStream& 
rStrm )
     if( (rStrm.GetNextRecId() == EXC_ID_COORDLIST) && rStrm.StartNextRecord() )
     {
         OSL_ENSURE( rStrm.GetRecLeft() / 4 == mnPointCount, 
"XclImpPolygonObj::ReadCoordList - wrong polygon point count" );
-        while( rStrm.GetRecLeft() >= 4 )
+        while (true)
         {
-            sal_uInt16 nX, nY;
-            nX = rStrm.ReaduInt16();
-            nY = rStrm.ReaduInt16();
+            if (rStrm.GetRecLeft() < 4)
+                break;
+            sal_uInt16 nX = rStrm.ReaduInt16();
+            sal_uInt16 nY = rStrm.ReaduInt16();
             maCoords.emplace_back( nX, nY );
         }
     }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to