sc/source/filter/excel/xistream.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
New commits: commit 763996f29aef31f95c438738d081d9b361db36e3 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Aug 23 19:55:59 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Aug 24 09:33:41 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 <caol...@redhat.com> 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 )