core: Fix invalid string length

This commit is contained in:
Martin Fleisz 2023-02-09 12:27:54 +01:00
parent 4b9fb8fff9
commit 35c24f208b

View File

@ -571,7 +571,7 @@ static BOOL rdp_write_extended_info_packet(rdpRdp* rdp, wStream* s)
if (tz)
rlen = strnlen(tz, 254);
Stream_Write_UINT16(s, (UINT16)rlen);
if (Stream_Write_UTF16_String_From_UTF8(s, rlen / sizeof(WCHAR), tz, rlen, FALSE) < 0)
if (Stream_Write_UTF16_String_From_UTF8(s, rlen, tz, rlen, FALSE) < 0)
goto fail;
Stream_Write_UINT16(s, settings->DynamicDaylightTimeDisabled ? 0x01 : 0x00);
}