[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 25 12:57:58 UTC 2021


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

New commits:
commit ce215eb1e7418ce056f0bfc0ae40d614ac5dbf5e
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 23 19:55:59 2021 +0100
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Wed Aug 25 14:57:24 2021 +0200

    ofz: MemorySanitizer: use-of-uninitialized-value
    
    Change-Id: Ia7ceb0278117df6e140c04232bcfd366fbba3dd0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120919
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    (cherry picked from commit 763996f29aef31f95c438738d081d9b361db36e3)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120979
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>

diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx
index df5500cc376d..702ae253e143 100644
--- a/sc/source/filter/excel/xistream.cxx
+++ b/sc/source/filter/excel/xistream.cxx
@@ -389,10 +389,10 @@ XclBiff XclImpStream::DetectBiffVersion( SvStream& rStrm )
     XclBiff eBiff = EXC_BIFF_UNKNOWN;
 
     rStrm.Seek( STREAM_SEEK_TO_BEGIN );
-    sal_uInt16 nBofId, nBofSize;
+    sal_uInt16 nBofId(0), nBofSize(0);
     rStrm.ReadUInt16( nBofId ).ReadUInt16( nBofSize );
 
-    if( (4 <= nBofSize) && (nBofSize <= 16) ) switch( nBofId )
+    if (rStrm.good() && 4 <= nBofSize && nBofSize <= 16) switch( nBofId )
     {
         case EXC_ID2_BOF:
             eBiff = EXC_BIFF2;
@@ -405,7 +405,7 @@ XclBiff XclImpStream::DetectBiffVersion( SvStream& rStrm )
         break;
         case EXC_ID5_BOF:
         {
-            sal_uInt16 nVersion;
+            sal_uInt16 nVersion(0);
             rStrm.ReadUInt16( nVersion );
             // #i23425# #i44031# #i62752# there are some *really* broken documents out there...
             switch( nVersion & 0xFF00 )


More information about the Libreoffice-commits mailing list