[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - vcl/source
Caolán McNamara
caolanm at redhat.com
Mon Jan 2 23:41:31 UTC 2017
vcl/source/filter/wmf/winwmf.cxx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 03b6eff8ba1d7102608221e6bf94f581aba2ee9d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Dec 22 11:09:08 2016 +0000
valgrind: stick 0 at end of successfully read data
(cherry picked from commit 0dfc6f70ab53a773ee05664235d7c8927ab20f2c)
(cherry picked from commit 3ea598f65bed096dbf4bda5fe4105b57c58b5310)
Change-Id: Id79f68c9095ab313ac05d2c8b55df71788df81d3
Reviewed-on: https://gerrit.libreoffice.org/32335
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index c4f7e78..0b7b207 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -886,7 +886,6 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
{
Size aFontSize;
char lfFaceName[LF_FACESIZE+1];
- lfFaceName[LF_FACESIZE] = 0;
sal_Int16 lfEscapement = 0;
sal_Int16 lfOrientation = 0;
sal_Int16 lfWeight = 0;
@@ -904,7 +903,8 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
pWMF->ReadUChar( aLogFont.lfClipPrecision );
pWMF->ReadUChar( aLogFont.lfQuality );
pWMF->ReadUChar( aLogFont.lfPitchAndFamily );
- pWMF->Read( lfFaceName, LF_FACESIZE );
+ size_t nRet = pWMF->Read( lfFaceName, LF_FACESIZE );
+ lfFaceName[nRet] = 0;
aLogFont.lfWidth = aFontSize.Width();
aLogFont.lfHeight = aFontSize.Height();
aLogFont.lfEscapement = lfEscapement;
More information about the Libreoffice-commits
mailing list