[warnings] fix various clang-tidy warnings

This commit is contained in:
akallabeth
2024-08-29 16:13:43 +02:00
parent 500495dc00
commit bd637c6cd1
18 changed files with 35 additions and 36 deletions

View File

@@ -502,7 +502,6 @@ fail:
*/
static UINT rdpgfx_recv_reset_graphics_pdu(GENERIC_CHANNEL_CALLBACK* callback, wStream* s)
{
int pad = 0;
MONITOR_DEF* monitor = NULL;
RDPGFX_RESET_GRAPHICS_PDU pdu = { 0 };
WINPR_ASSERT(callback);
@@ -543,7 +542,13 @@ static UINT rdpgfx_recv_reset_graphics_pdu(GENERIC_CHANNEL_CALLBACK* callback, w
Stream_Read_UINT32(s, monitor->flags); /* flags (4 bytes) */
}
pad = 340 - (RDPGFX_HEADER_SIZE + 12 + (pdu.monitorCount * 20));
const size_t size = (RDPGFX_HEADER_SIZE + 12ULL + (pdu.monitorCount * 20ULL));
if (size > 340)
{
free(pdu.monitorDefArray);
return CHANNEL_RC_NULL_DATA;
}
const size_t pad = 340ULL - size;
if (!Stream_CheckAndLogRequiredLength(TAG, s, (size_t)pad))
{