diff options
author | Michael Meeks <michael.meeks@suse.com> | 2013-03-21 15:21:28 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-03-21 15:22:12 +0000 |
commit | 5c4bf7a6029da36853fbae1513c9c5ed993059a3 (patch) | |
tree | 7364e07ef90bfb2db1e30ad1fd194a16f2bfdc93 /rsc/source/tools/rsctools.cxx | |
parent | 3b00a7f87b8d428dc8c3d1d0ddb84b74bb2343d4 (diff) |
stop uninitialized memory leaking into resource files.
Change-Id: Ifb74ce0c60e0d0796d5d04a67e9d58721b58593c
Diffstat (limited to 'rsc/source/tools/rsctools.cxx')
-rw-r--r-- | rsc/source/tools/rsctools.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx index 7e94c6e1e505..dd378e482396 100644 --- a/rsc/source/tools/rsctools.cxx +++ b/rsc/source/tools/rsctools.cxx @@ -359,10 +359,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; } /************************************************************************* |