diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-08-30 09:15:43 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-08-30 11:53:27 +0200 |
commit | ba4244e834dfdac5488023cc2f62bb83fbd2d011 (patch) | |
tree | b87ea37c3c9a0a8c4e962e8839583fab2a1933cc /sc/source | |
parent | 349c5cacedccbfbb71846ae3b276285d54c0d0b8 (diff) |
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@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/filter/lotus/op.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
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); } |