summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rsc/source/tools/rsctools.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx
index 5a486e0eecbf..83526835b7f6 100644
--- a/rsc/source/tools/rsctools.cxx
+++ b/rsc/source/tools/rsctools.cxx
@@ -305,7 +305,11 @@ void RscWriteRc :: PutUTF8( char * pStr )
n++;
sal_uInt32 nOldLen = IncSize( n );
- memcpy( GetPointer( nOldLen ), pStr, nStrLen );
+ char * p = GetPointer( nOldLen );
+ if (nStrLen != 0)
+ {
+ memcpy( p, pStr, nStrLen );
+ }
// 0 terminated
pMem[ nOldLen + nStrLen ] = '\0';
}