sc/source/filter/qpro/qpro.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 9e0e25c489e0ee170ef4f212efa707734f581347
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Aug 31 16:56:56 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Wed Sep 1 09:30:23 2021 +0200

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

diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx
index 9c64fdd67393..7bb6c82b5611 100644
--- a/sc/source/filter/qpro/qpro.cxx
+++ b/sc/source/filter/qpro/qpro.cxx
@@ -70,6 +70,11 @@ ErrCode ScQProReader::readSheet( SCTAB nTab, ScDocument& 
rDoc, ScQProStyle *pSty
 
             case 0x000c: // Blank cell
                 mpStream->ReadUChar( nCol ).ReadUChar( nDummy ).ReadUInt16( 
nRow ).ReadUInt16( nStyle );
+                if (!mpStream->good())
+                {
+                    eRet = SCERR_IMPORT_FORMAT;
+                    break;
+                }
                 nStyle = nStyle >> 3;
                 pStyle->SetFormat( &rDoc, nCol, nRow, nTab, nStyle );
                 break;
@@ -77,6 +82,11 @@ ErrCode ScQProReader::readSheet( SCTAB nTab, ScDocument& 
rDoc, ScQProStyle *pSty
             case 0x000d:{ // Integer cell
                 sal_Int16 nValue;
                 mpStream->ReadUChar( nCol ).ReadUChar( nDummy ).ReadUInt16( 
nRow ).ReadUInt16( nStyle ).ReadInt16( nValue );
+                if (!mpStream->good())
+                {
+                    eRet = SCERR_IMPORT_FORMAT;
+                    break;
+                }
                 nStyle = nStyle >> 3;
                 pStyle->SetFormat( &rDoc, nCol, nRow, nTab, nStyle );
                 rDoc.EnsureTable(nTab);

Reply via email to