summaryrefslogtreecommitdiff
path: root/rsc
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2013-03-21 15:21:28 +0000
committerAndras Timar <atimar@suse.com>2013-04-02 13:48:33 -0700
commit5c24c10d5ce7b3c37736f6edd41c611afa886db2 (patch)
treebcdfcc1f085c891f8b6ee9f7b7458ddad94d0a9a /rsc
parent42678960593bff851d3359839a51422920c49662 (diff)
stop uninitialized memory leaking into resource files.
Change-Id: Ifb74ce0c60e0d0796d5d04a67e9d58721b58593c Signed-off-by: Andras Timar <atimar@suse.com>
Diffstat (limited to 'rsc')
-rw-r--r--rsc/source/tools/rsctools.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx
index 63d787e4e12f..02507cc030e0 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;
}
/*************************************************************************