From 42c178bef78efeaa3ab2e31ca5d466105966e5f3 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 2 Jun 2015 16:56:19 +0200 Subject: -fsanitize=nonnull-attribute in memcpy call Change-Id: I0ed38aa54e1b403f015c27b27edb4710e935d961 --- tools/source/stream/stream.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- cgit