summaryrefslogtreecommitdiff
path: root/vcl/source/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-12-22 11:09:08 +0000
committerAndras Timar <andras.timar@collabora.com>2017-02-08 11:56:05 +0100
commit9460b43a2aadf958eb5bb6202952742e48b6a007 (patch)
tree7e80317d085369ee0351c602057431dc928527d4 /vcl/source/filter
parent2678e34494904fba8722fcab861238e69f64ab3f (diff)
valgrind: stick 0 at end of successfully read data
(cherry picked from commit 0dfc6f70ab53a773ee05664235d7c8927ab20f2c) (cherry picked from commit 3ea598f65bed096dbf4bda5fe4105b57c58b5310) Reviewed-on: https://gerrit.libreoffice.org/32335 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit 03b6eff8ba1d7102608221e6bf94f581aba2ee9d) Change-Id: Id79f68c9095ab313ac05d2c8b55df71788df81d3
Diffstat (limited to 'vcl/source/filter')
-rw-r--r--vcl/source/filter/wmf/winwmf.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index 515d56ba6c9a..1f30bb9e18df 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -884,7 +884,7 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc )
case W_META_CREATEFONTINDIRECT:
{
Size aFontSize;
- char lfFaceName[LF_FACESIZE];
+ char lfFaceName[LF_FACESIZE+1];
sal_Int16 lfEscapement = 0;
sal_Int16 lfOrientation = 0;
sal_Int16 lfWeight = 0;
@@ -902,7 +902,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;