[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - vcl/source

Caolán McNamara caolanm at redhat.com
Fri Jan 9 10:25:47 PST 2015


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

New commits:
commit c74bbf75700d3a801f75c25b5e9baaaac851ef2d
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
    (cherry picked from commit 8f43132c4d68dd2a1af7a4d1088413c2a0064902)
    Reviewed-on: https://gerrit.libreoffice.org/13834
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx
index 290437c..d55349f 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