[Libreoffice-commits] core.git: 3 commits - rsc/source sal/osl tools/source

Stephan Bergmann sbergman at redhat.com
Tue Jun 2 07:57:11 PDT 2015


 rsc/source/tools/rsctools.cxx  |    6 +++++-
 sal/osl/unx/file.cxx           |    2 +-
 tools/source/stream/stream.cxx |    5 ++++-
 3 files changed, 10 insertions(+), 3 deletions(-)

New commits:
commit 42c178bef78efeaa3ab2e31ca5d466105966e5f3
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jun 2 16:56:19 2015 +0200

    -fsanitize=nonnull-attribute in memcpy call
    
    Change-Id: I0ed38aa54e1b403f015c27b27edb4710e935d961

diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 2e98799..b96da82 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;
 }
commit eee25979d16e2a53f31311774812cb5866d020bc
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jun 2 16:56:13 2015 +0200

    -fsanitize=nonnull-attribute in memcpy call
    
    Change-Id: Ic2fc0752f2bce2d565ca58b1c804bfd601b80875

diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index 73612a3..aa918c8 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -678,7 +678,7 @@ oslFileError FileHandle_Impl::writeSequence_Impl (
         /* resize sequence */
         rtl_byte_sequence_realloc(ppSequence, nElements);
     }
-    if (*ppSequence != 0)
+    if (*ppSequence != 0 && nBytes != 0)
     {
         /* fill sequence */
         memcpy(&((*ppSequence)->elements[*pnOffset]), pBuffer, nBytes), *pnOffset += nBytes;
commit 2bc0a808392cff87342bf9377c4066169c7150e7
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jun 2 16:56:08 2015 +0200

    -fsanitize=nonnull-attribute in memcpy call
    
    Change-Id: I4fc491906311781b9941c8f02d99d254542027ae

diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx
index 5a486e0..8352683 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';
 }


More information about the Libreoffice-commits mailing list