[warnings] fix integer narrowing

This commit is contained in:
akallabeth 2024-10-03 13:15:24 +02:00
parent fe8e1950aa
commit 2e23ddfc1c
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5

View File

@ -1066,9 +1066,12 @@ BOOL fastpath_send_multiple_input_pdu(rdpFastPath* fastpath, wStream* s, size_t
if (!security_lock(rdp)) if (!security_lock(rdp))
goto fail; goto fail;
int sec_bytes = fastpath_get_sec_bytes(fastpath->rdp); const size_t sec_bytes = fastpath_get_sec_bytes(fastpath->rdp);
if (sec_bytes + 3ULL > length)
goto fail;
BYTE* fpInputEvents = Stream_PointerAs(s, BYTE) + sec_bytes; BYTE* fpInputEvents = Stream_PointerAs(s, BYTE) + sec_bytes;
UINT16 fpInputEvents_length = length - 3 - sec_bytes; const UINT16 fpInputEvents_length = (UINT16)length - 3 - sec_bytes;
WINPR_ASSERT(rdp->settings); WINPR_ASSERT(rdp->settings);
if (rdp->settings->EncryptionMethods == ENCRYPTION_METHOD_FIPS) if (rdp->settings->EncryptionMethods == ENCRYPTION_METHOD_FIPS)