[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.2' - sw/source

Caolán McNamara caolanm at redhat.com
Mon Jan 5 08:37:25 PST 2015


 sw/source/filter/ascii/parasc.cxx |    1 +
 1 file changed, 1 insertion(+)

New commits:
commit ba5d09072c4e9c103f6af3c44e689bc6c93e0477
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 5 15:49:47 2015 +0000

    valgrind: uninitialized read
    
    on loading id:000386,src:000000,op:havoc,rep:128.jpg as text
    
    Change-Id: I98364ffbcc4ea788613cc8071c4d8774ba167033
    (cherry picked from commit 0b39d560da27ece227830a4bcc5556ae902a0921)
    Reviewed-on: https://gerrit.libreoffice.org/13744
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx
index ddc6855..11c7f2e 100644
--- a/sw/source/filter/ascii/parasc.cxx
+++ b/sw/source/filter/ascii/parasc.cxx
@@ -324,6 +324,7 @@ sal_uLong SwASCIIParser::ReadChars()
                 sal_Size nNewLen = lGCount, nCntBytes;
                 aWork.reset(new sal_Unicode[nNewLen + 1]); // add 1 for '\0'
                 sal_Unicode* pBuf = aWork.get();
+                pBuf[nNewLen] = 0;                         // ensure '\0'
 
                 nNewLen = rtl_convertTextToUnicode( hConverter, hContext,
                                 pArr, lGCount, pBuf, nNewLen,


More information about the Libreoffice-commits mailing list