[Libreoffice-commits] core.git: Branch 'feature/cib_contract57' - shell/source

Stephan Bergmann sbergman at redhat.com
Wed Aug 30 16:45:40 UTC 2017


 shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 29ac454276153709a7767ec1d46444ad73a8b01b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Nov 13 22:51:45 2015 +0100

    -Werror,-Wsizeof-pointer-memaccess
    
    Change-Id: I08d4331e5b2c9d17d16b1415d321c4f38322c251
    (cherry picked from commit 69d64cce8847a039a17128e3eaa301917faf6221)

diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
index fbc38528430c..f1dcfa53c8ac 100644
--- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
+++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
@@ -422,8 +422,9 @@ SCODE STDMETHODCALLTYPE COooFilter::GetText(ULONG * pcwcBuffer, WCHAR * awcBuffe
         }
         // Copy UNICODE characters in chunk buffer to output UNICODE buffer
         ULONG ulToCopy = min( *pcwcBuffer, m_ulUnicodeBufferLen - m_ulUnicodeCharsRead );
-        ZeroMemory(awcBuffer, sizeof(awcBuffer));
         wmemcpy( awcBuffer, m_pwsBuffer.c_str() + m_ulUnicodeCharsRead, ulToCopy );
+        ZeroMemory(
+             awcBuffer + ulToCopy, (*pcwcBuffer - ulToCopy) * sizeof (WCHAR));
         m_ulUnicodeCharsRead += ulToCopy;
         *pcwcBuffer = ulToCopy;
         if ( m_ulUnicodeBufferLen == m_ulUnicodeCharsRead )


More information about the Libreoffice-commits mailing list