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

Caolán McNamara caolanm at redhat.com
Fri Jan 9 06:56:53 PST 2015


 vcl/source/filter/wmf/enhwmf.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 8f43132c4d68dd2a1af7a4d1088413c2a0064902
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jan 9 14:55:35 2015 +0000

    asan: stack-buffer-overflow with fdo76216-1.doc
    
    Change-Id: Ica5ebb04ec50c6579f71d1152ae7619dd37b879e

diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx
index eaf080e..95790be 100644
--- a/vcl/source/filter/wmf/enhwmf.cxx
+++ b/vcl/source/filter/wmf/enhwmf.cxx
@@ -1373,13 +1373,13 @@ bool EnhWMFReader::ReadEnhWMF()
                              .ReadUChar( aLogFont.lfQuality )
                              .ReadUChar( aLogFont.lfPitchAndFamily );
 
-                        sal_Unicode lfFaceName[ LF_FACESIZE ];
-
-                        for ( int i = 0; i < LF_FACESIZE; i++ )
+                        sal_Unicode lfFaceName[LF_FACESIZE+1];
+                        lfFaceName[LF_FACESIZE] = 0;
+                        for (int i = 0; i < LF_FACESIZE; ++i)
                         {
-                            sal_uInt16 nChar;
-                            pWMF->ReadUInt16( nChar );
-                            lfFaceName[ i ] = nChar;
+                            sal_uInt16 nChar(0);
+                            pWMF->ReadUInt16(nChar);
+                            lfFaceName[i] = nChar;
                         }
                         aLogFont.alfFaceName = OUString( lfFaceName );
 


More information about the Libreoffice-commits mailing list