From: dahyeong.kim Date: Wed, 5 Jun 2013 04:52:34 +0000 (+0900) Subject: [2.2] Expand the destCapacity due to U_BUFFER_OVERFLOW_ERROR X-Git-Tag: accepted/tizen/20130912.081851^2~267^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d36ed27d868596ce8226d7b631c03efa190b7e7e;p=platform%2Fframework%2Fnative%2Fappfw.git [2.2] Expand the destCapacity due to U_BUFFER_OVERFLOW_ERROR Change-Id: I5df55102dd58e4fe37478b58d779f9f5b01e07d0 Signed-off-by: dahyeong.kim --- 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));