summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-02 16:56:19 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-06-02 16:56:19 +0200
commit42c178bef78efeaa3ab2e31ca5d466105966e5f3 (patch)
tree7133a425b13a81fec2ac0dbea97d8e6087930978 /tools
parenteee25979d16e2a53f31311774812cb5866d020bc (diff)
-fsanitize=nonnull-attribute in memcpy call
Change-Id: I0ed38aa54e1b403f015c27b27edb4710e935d961
Diffstat (limited to 'tools')
-rw-r--r--tools/source/stream/stream.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 2e98799d2b9d..b96da82b326a 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -1771,7 +1771,10 @@ sal_Size SvMemoryStream::GetData( void* pData, sal_Size nCount )
sal_Size nMaxCount = nEndOfData-nPos;
if( nCount > nMaxCount )
nCount = nMaxCount;
- memcpy( pData, pBuf+nPos, (size_t)nCount );
+ if (nCount != 0)
+ {
+ memcpy( pData, pBuf+nPos, (size_t)nCount );
+ }
nPos += nCount;
return nCount;
}