summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-08-23 19:55:59 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-08-25 14:57:24 +0200
commitce215eb1e7418ce056f0bfc0ae40d614ac5dbf5e (patch)
tree3d2caeb03e8beb88ef60099192b7d9f56c065663
parent47de9b2acabde7835471d57e165c1228bc07c0d3 (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> (cherry picked from commit 763996f29aef31f95c438738d081d9b361db36e3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120979 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--sc/source/filter/excel/xistream.cxx6
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 )