Fix invalid memory write in StringUtils::ConvertANSI2UTF16 on Unix if length is empty

This commit is contained in:
Wojtek Figat
2021-10-17 16:00:55 +02:00
parent 6f84bffaad
commit e7edbacd69

View File

@@ -313,6 +313,8 @@ static inline uint32 Utf8ToUtf32Codepoint(const char* src, int32 length)
void StringUtils::ConvertANSI2UTF16(const char* from, Char* to, int32 len)
{
if (len == 0)
return;
const char* const u8end = from + len;
const char* u8cur = from;
char16_t* u16cur = to;