diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/source/win32/shlxthandler/ooofilt/ooofilt.cxx | 3 |
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 ) |