diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-08-23 19:55:59 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-08-24 09:33:41 +0200 |
commit | 763996f29aef31f95c438738d081d9b361db36e3 (patch) | |
tree | 266c64c205619752d1af43c35ecf7a86dd8b1c25 | |
parent | 253c8adddb04529185c74aef5e5278eb71d309ab (diff) |
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@redhat.com>
-rw-r--r-- | sc/source/filter/excel/xistream.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
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 ) |