Fixed rail_string_to_unicode_string size calculation.
authorArmin Novak <armin.novak@thincast.com>
Wed, 14 Nov 2018 10:03:59 +0000 (11:03 +0100)
committerArmin Novak <armin.novak@thincast.com>
Wed, 14 Nov 2018 10:03:59 +0000 (11:03 +0100)
channels/rail/rail_common.c

index af88a96..ac0103f 100644 (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))
        {