[Libreoffice-commits] core.git: Branch 'distro/suse/suse-4.0' - 2 commits - rsc/source

Andras Timar atimar at suse.com
Tue Apr 2 13:49:14 PDT 2013


 rsc/source/tools/rsctools.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 8ea005ebaa5a444edec121804cc80d089ec05785
Author: Andras Timar <atimar at suse.com>
Date:   Wed Mar 27 02:23:38 2013 -0700

    stop uninitialized memory leaking into resource files.
    
    Change-Id: I8659426dd4ea0c13c8ed839ef5cfb686e6648042
    Reviewed-on: https://gerrit.libreoffice.org/3080
    Reviewed-by: Michael Meeks <michael.meeks at suse.com>
    Tested-by: Michael Meeks <michael.meeks at suse.com>
    Signed-off-by: Andras Timar <atimar at suse.com>

diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx
index 02507cc..a9dfb1b 100644
--- a/rsc/source/tools/rsctools.cxx
+++ b/rsc/source/tools/rsctools.cxx
@@ -377,7 +377,10 @@ sal_uInt32 RscWriteRc :: IncSize( sal_uInt32 nSize )
 char * RscWriteRc :: GetPointer( sal_uInt32 nSize )
 {
     if( !pMem )
+    {
         pMem = (char *)rtl_allocateMemory( nLen );
+        memset( pMem, 0, nLen );
+    }
     return( pMem + nSize );
 }
 
commit 5c24c10d5ce7b3c37736f6edd41c611afa886db2
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Thu Mar 21 15:21:28 2013 +0000

    stop uninitialized memory leaking into resource files.
    
    Change-Id: Ifb74ce0c60e0d0796d5d04a67e9d58721b58593c
    Signed-off-by: Andras Timar <atimar at suse.com>

diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx
index 63d787e..02507cc 100644
--- a/rsc/source/tools/rsctools.cxx
+++ b/rsc/source/tools/rsctools.cxx
@@ -360,10 +360,13 @@ RscWriteRc :: ~RscWriteRc()
 *************************************************************************/
 sal_uInt32 RscWriteRc :: IncSize( sal_uInt32 nSize )
 {
+    sal_uInt32 nOrigPos = nLen;
     nLen += nSize;
     if( pMem )
         pMem = (char*)rtl_reallocateMemory( pMem, nLen );
-    return( nLen - nSize );
+    if( pMem )
+        memset( pMem + nOrigPos, 0, nSize );
+    return nOrigPos;
 }
 
 /*************************************************************************


More information about the Libreoffice-commits mailing list