Fixed rail_string_to_unicode_string size calculation.

This commit is contained in:
Armin Novak 2018-11-14 11:03:59 +01:00
parent 9292b2231f
commit e500abc092
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ BOOL rail_string_to_unicode_string(const char* string, RAIL_UNICODE_STRING* unic
if (!string || strlen(string) < 1)
return TRUE;
length = ConvertToUnicode(CP_UTF8, 0, string, -1, &buffer, 0) * 2;
length = ConvertToUnicode(CP_UTF8, 0, string, -1, &buffer, 0);
if ((length < 0) || ((size_t)length * sizeof(WCHAR) > UINT16_MAX))
{