[Libreoffice-commits] core.git: sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 2 09:19:08 UTC 2021


 sc/source/filter/lotus/lotimpop.cxx |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 7d0d07ed0f572c99c70d7f4384dfce644cbbf939
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Sep 1 20:16:23 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Sep 2 11:18:33 2021 +0200

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

diff --git a/sc/source/filter/lotus/lotimpop.cxx b/sc/source/filter/lotus/lotimpop.cxx
index c22a40634d22..ca5a2f13edf8 100644
--- a/sc/source/filter/lotus/lotimpop.cxx
+++ b/sc/source/filter/lotus/lotimpop.cxx
@@ -162,11 +162,16 @@ void ImportLotus::Userrange()
     Read( nRangeType );
 
     char aBuffer[ 17 ];
-    pIn->ReadBytes(aBuffer, 16);
-    aBuffer[ 16 ] = 0;
-    OUString      aName( aBuffer, strlen(aBuffer), eQuellChar );
+    aBuffer[pIn->ReadBytes(aBuffer, 16)] = 0;
+    OUString aName(aBuffer, strlen(aBuffer), eQuellChar);
 
-    Read( aScRange );
+    Read(aScRange);
+
+    if (!pIn->good())
+    {
+        SAL_WARN("sc.filter", "invalid range");
+        return;
+    }
 
     LotusContext &rContext = aConv.getContext();
     rContext.pRngNmBffWK3->Add( rContext.rDoc, aName, aScRange );


More information about the Libreoffice-commits mailing list