mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[channels,cliprdr] improve casts
This commit is contained in:
@@ -66,14 +66,16 @@ static UINT cliprdr_packet_send(cliprdrPlugin* cliprdr, wStream* s)
|
||||
WINPR_ASSERT(s);
|
||||
|
||||
const size_t pos = Stream_GetPosition(s);
|
||||
const size_t dataLen = pos - 8ULL;
|
||||
WINPR_ASSERT(dataLen <= UINT32_MAX);
|
||||
WINPR_ASSERT(pos >= 8ULL);
|
||||
WINPR_ASSERT(pos <= UINT32_MAX - 8);
|
||||
|
||||
const uint32_t dataLen = WINPR_ASSERTING_INT_CAST(uint32_t, pos - 8UL);
|
||||
|
||||
Stream_SetPosition(s, 4);
|
||||
Stream_Write_UINT32(s, (UINT32)dataLen);
|
||||
Stream_Write_UINT32(s, dataLen);
|
||||
Stream_SetPosition(s, pos);
|
||||
|
||||
WLog_Print(cliprdr->log, WLOG_DEBUG, "Cliprdr Sending (%" PRIuz " bytes)", dataLen + 8UL);
|
||||
WLog_Print(cliprdr->log, WLOG_DEBUG, "Cliprdr Sending (%" PRIuz " bytes)", pos);
|
||||
|
||||
if (!cliprdr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user