From b3aacb65883e789155a54658b98f891c0ddbe5a8 Mon Sep 17 00:00:00 2001 From: "dahyeong.kim" Date: Tue, 4 Jun 2013 22:05:38 +0900 Subject: [PATCH] Expand the destCapacity due to U_BUFFER_OVERFLOW_ERROR Change-Id: I5276ff6b461a5cd2150519d506a5eec5de6f7379 Signed-off-by: dahyeong.kim --- src/base/utility/FBaseUtil_IcuConverter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/utility/FBaseUtil_IcuConverter.cpp b/src/base/utility/FBaseUtil_IcuConverter.cpp index e808ffb..b974646 100644 --- a/src/base/utility/FBaseUtil_IcuConverter.cpp +++ b/src/base/utility/FBaseUtil_IcuConverter.cpp @@ -241,7 +241,7 @@ WcharToUtf8N(const wchar_t* pValue) UChar* pResultStr = u_strFromWCS(pIcuStr.get(), icuStrCapacity, &outLen, pValue, len, &err); SysTryReturn(NID_BASE_UTIL, U_SUCCESS(err), null, E_INVALID_ARG, "[%s] u_strFromWCS() failed. pValue is %ls.", GetErrorMessage(E_INVALID_ARG), pValue); - int destCapacity = outLen * 2 + 1; + int destCapacity = len * 4 + 1; std::unique_ptr< char[] > pDst(new (std::nothrow) char[destCapacity]); SysTryReturn(NID_BASE_UTIL, pDst != null, null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); -- 2.7.4