sc/source/filter/lotus/lotimpop.cxx |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 00abfe06caa489559cbda0db082f5e118a324f6c
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Sep 3 09:33:09 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Sep 3 15:47:10 2021 +0200

    ofz: MemorySanitizer: use-of-uninitialized-value
    
    Change-Id: I3ea65a72567e934325e24ff658fc1b9c0468abcb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121591
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/filter/lotus/lotimpop.cxx 
b/sc/source/filter/lotus/lotimpop.cxx
index ca5a2f13edf8..ed06a7ab373f 100644
--- a/sc/source/filter/lotus/lotimpop.cxx
+++ b/sc/source/filter/lotus/lotimpop.cxx
@@ -318,18 +318,20 @@ void ImportLotus::RowPresentation( sal_uInt16 nRecLen )
 {
     SAL_WARN_IF( nRecLen < 5, "sc.filter", "*ImportLotus::RowPresentation(): 
Record too short!" );
 
-    sal_uInt8    nLTab, nFlags;
-    sal_uInt16  nRow, nHeight;
-    sal_uInt16    nCnt = (nRecLen < 4) ? 0 : ( nRecLen - 4 ) / 8;
+    sal_uInt16 nCnt = (nRecLen < 4) ? 0 : ( nRecLen - 4 ) / 8;
 
+    sal_uInt8 nLTab(0);
     Read( nLTab );
     Skip( 1 );
 
-    while( nCnt )
+    while (nCnt && pIn->good())
     {
+        sal_uInt16 nRow(0);
         Read( nRow );
+        sal_uInt16 nHeight(0);
         Read( nHeight );
         Skip( 2 );
+        sal_uInt8 nFlags(0);
         Read( nFlags );
         Skip( 1 );
 

Reply via email to