diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-09-05 09:33:47 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-09-05 14:32:59 +0200 |
commit | 052afc10c565940fa947e56c49e132aeb94ae03c (patch) | |
tree | f90034f146f9a3c72f21dbf8650a43406526fac1 /vcl | |
parent | 08665e27e1d66cde90bac978eed4cee998b1d5d5 (diff) |
ofz: MemorySanitizer: use-of-uninitialized-value
Change-Id: Ib63d500480a78a144b127c4230542507132d0a5b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121669
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/filter/ipict/ipict.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/vcl/source/filter/ipict/ipict.cxx b/vcl/source/filter/ipict/ipict.cxx index 8c9494c36448..d434763dd4be 100644 --- a/vcl/source/filter/ipict/ipict.cxx +++ b/vcl/source/filter/ipict/ipict.cxx @@ -1602,8 +1602,6 @@ sal_uInt64 PictReader::ReadData(sal_uInt16 nOpcode) break; case 0x002c: { // fontName - char sFName[ 256 ], nByteLen; - sal_uInt16 nLen; pPict->ReadUInt16( nUSHORT ); nDataSize=nUSHORT+2; pPict->ReadUInt16( nUSHORT ); if (nUSHORT <= 1) aActFont.SetFamily(FAMILY_SWISS); @@ -1614,9 +1612,11 @@ sal_uInt64 PictReader::ReadData(sal_uInt16 nOpcode) else if (nUSHORT <= 1023) aActFont.SetFamily(FAMILY_SWISS); else aActFont.SetFamily(FAMILY_ROMAN); aActFont.SetCharSet(GetTextEncoding(nUSHORT)); - pPict->ReadChar( nByteLen ); nLen=static_cast<sal_uInt16>(nByteLen)&0x00ff; - pPict->ReadBytes(&sFName, nLen); - sFName[ nLen ] = 0; + char nByteLen(0); + pPict->ReadChar( nByteLen ); + sal_uInt16 nLen = static_cast<sal_uInt16>(nByteLen)&0x00ff; + char sFName[ 256 ]; + sFName[pPict->ReadBytes(sFName, nLen)] = 0; OUString aString( sFName, strlen(sFName), osl_getThreadTextEncoding() ); aActFont.SetFamilyName( aString ); eActMethod = PictDrawingMethod::UNDEFINED; |