(#503) Fix sandboxie.ini corruption by 3-byte UTF-8 chars.
This commit is contained in:
parent
b80910852e
commit
bdd0c17e1e
|
@ -1462,8 +1462,9 @@ ULONG SbieIniServer::RefreshConf()
|
||||||
char* text_utf8 = NULL;
|
char* text_utf8 = NULL;
|
||||||
if (IsUTF8)
|
if (IsUTF8)
|
||||||
{
|
{
|
||||||
text_utf8 = (char*)HeapAlloc(GetProcessHeap(), 0, lenToWrite + 16);
|
ULONG utf8_len = WideCharToMultiByte(CP_UTF8, 0, m_text_base, lenToWrite / sizeof(WCHAR), NULL, 0, NULL, NULL);
|
||||||
lenToWrite = WideCharToMultiByte(CP_UTF8, 0, m_text_base, lenToWrite / sizeof(WCHAR), text_utf8, lenToWrite + 16, NULL, NULL);
|
text_utf8 = (char*)HeapAlloc(GetProcessHeap(), 0, utf8_len);
|
||||||
|
lenToWrite = WideCharToMultiByte(CP_UTF8, 0, m_text_base, lenToWrite / sizeof(WCHAR), text_utf8, utf8_len, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG lenWritten = 0;
|
ULONG lenWritten = 0;
|
||||||
|
|
Loading…
Reference in New Issue