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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Mon Aug 30 09:54:00 UTC 2021


 sc/source/filter/lotus/op.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit ba4244e834dfdac5488023cc2f62bb83fbd2d011
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 30 09:15:43 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Aug 30 11:53:27 2021 +0200

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

diff --git a/sc/source/filter/lotus/op.cxx b/sc/source/filter/lotus/op.cxx
index 44c766f8c163..b245e0f04987 100644
--- a/sc/source/filter/lotus/op.cxx
+++ b/sc/source/filter/lotus/op.cxx
@@ -116,16 +116,16 @@ void OP_Label(LotusContext& rContext, SvStream& r, sal_uInt16 n)
 
     n -= std::min<sal_uInt16>(n, 5);
 
-    std::unique_ptr<char[]> pText(new char[n + 1]);
-    r.ReadBytes(pText.get(), n);
-    pText[n] = 0;
+    std::vector<char> aText(n + 1);
+    n = r.ReadBytes(aText.data(), n);
+    aText[n] = 0;
 
     if (rContext.rDoc.ValidColRow(nCol, nRow))
     {
         nFormat &= 0x80;    // don't change Bit 7
         nFormat |= 0x75;    // protected does not matter, special-text is set
 
-        PutFormString(rContext, nCol, nRow, 0, pText.get());
+        PutFormString(rContext, nCol, nRow, 0, aText.data());
 
         SetFormat(rContext, nCol, nRow, 0, nFormat, nFractionalStd);
     }


More information about the Libreoffice-commits mailing list