summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-13 22:51:45 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-18 17:19:17 +0100
commit69d64cce8847a039a17128e3eaa301917faf6221 (patch)
treeea2b5d8496e3cfbe0449369526559e5c288f18e2 /shell
parent6b26ed763f618a5f4c8fd21be0980a46c907bfe6 (diff)
-Werror,-Wsizeof-pointer-memaccess
Change-Id: I08d4331e5b2c9d17d16b1415d321c4f38322c251
Diffstat (limited to 'shell')
-rw-r--r--shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
index dbb4402dd0c0..819d5a4b0eba 100644
--- a/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
+++ b/shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx
@@ -418,8 +418,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 )