diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-06-02 16:56:08 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-06-02 16:56:08 +0200 |
commit | 2bc0a808392cff87342bf9377c4066169c7150e7 (patch) | |
tree | 25446e521d0948f72e80b31e7c68d88bcaee649d /rsc/source/tools | |
parent | c2d73acad34f43b7c48ef9a4e492ab5b48bb4852 (diff) |
-fsanitize=nonnull-attribute in memcpy call
Change-Id: I4fc491906311781b9941c8f02d99d254542027ae
Diffstat (limited to 'rsc/source/tools')
-rw-r--r-- | rsc/source/tools/rsctools.cxx | 6 |
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'; } |