From d40fea23a884ca16192f8d58ffc5cce78ffc7b0a Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 29 Mar 2017 15:02:46 -0700 Subject: Account for character size in last CFX_WideString patch. Change-Id: Ic3a72eb73afe86624dea406948b95dea70192e47 Reviewed-on: https://pdfium-review.googlesource.com/3296 Reviewed-by: Lei Zhang Reviewed-by: dsinclair Commit-Queue: dsinclair --- core/fxcrt/fx_basic_wstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/fxcrt/fx_basic_wstring.cpp b/core/fxcrt/fx_basic_wstring.cpp index 5c0b6ce061..81f463cc8e 100644 --- a/core/fxcrt/fx_basic_wstring.cpp +++ b/core/fxcrt/fx_basic_wstring.cpp @@ -613,7 +613,7 @@ void CFX_WideString::FormatV(const wchar_t* pFormat, va_list argList) { // -1 return code even though the buffer is written. Probably just as well // not to trust the vendor's implementation to write anything anyways. // See https://crbug.com/705912. - memset(m_pData->m_String, 0, nMaxLen + 1); + memset(m_pData->m_String, 0, (nMaxLen + 1) * sizeof(wchar_t)); FXSYS_vswprintf((wchar_t*)m_pData->m_String, nMaxLen + 1, (const wchar_t*)pFormat, argListSave); ReleaseBuffer(); -- cgit v1.2.3