Fixed various warnings

This commit is contained in:
akallabeth 2021-11-29 14:29:07 +01:00 committed by akallabeth
parent c1f44721c5
commit 6ee60ea15a
4 changed files with 107 additions and 98 deletions

View File

@ -899,8 +899,11 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, RFX_MESSAGE* messa
/* tiles */
close_cnt = 0;
rc = TRUE;
rc = FALSE;
if (Stream_GetRemainingLength(s) >= tilesDataSize)
{
rc = TRUE;
for (i = 0; i < message->numTiles; i++)
{
wStream subBuffer;
@ -925,8 +928,8 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, RFX_MESSAGE* messa
}
sub = Stream_StaticInit(&subBuffer, Stream_Pointer(s), Stream_GetRemainingLength(s));
Stream_Read_UINT16(sub,
blockType); /* blockType (2 bytes), must be set to CBT_TILE (0xCAC3) */
Stream_Read_UINT16(
sub, blockType); /* blockType (2 bytes), must be set to CBT_TILE (0xCAC3) */
Stream_Read_UINT32(sub, blockLen); /* blockLen (4 bytes) */
if (!Stream_SafeSeek(s, blockLen))
@ -1009,6 +1012,7 @@ static BOOL rfx_process_message_tileset(RFX_CONTEXT* context, RFX_MESSAGE* messa
rfx_decode_rgb(context, tile, tile->data, 64 * 4);
}
}
}
if (context->priv->UseThreads)
{

View File

@ -1005,15 +1005,22 @@ static BOOL rdp_recv_logon_info_v2(rdpRdp* rdp, wStream* s, logon_info* info)
UINT32 Size;
UINT32 cbDomain;
UINT32 cbUserName;
const size_t logonInfoV2Size = 576;
WINPR_UNUSED(rdp);
ZeroMemory(info, sizeof(*info));
if (Stream_GetRemainingLength(s) < 576)
if (Stream_GetRemainingLength(s) < logonInfoV2Size)
return FALSE;
Stream_Read_UINT16(s, Version); /* Version (2 bytes) */
if (Version != SAVE_SESSION_PDU_VERSION_ONE)
return FALSE;
Stream_Read_UINT32(s, Size); /* Size (4 bytes) */
if (Size != 18)
return FALSE;
Stream_Read_UINT32(s, info->sessionId); /* SessionId (4 bytes) */
Stream_Read_UINT32(s, cbDomain); /* cbDomain (4 bytes) */
Stream_Read_UINT32(s, cbUserName); /* cbUserName (4 bytes) */

View File

@ -1111,7 +1111,6 @@ BOOL mcs_send_channel_join_request(rdpMcs* mcs, UINT16 channelId)
BOOL mcs_recv_channel_join_confirm(rdpMcs* mcs, wStream* s, UINT16* channelId)
{
BOOL status;
UINT16 length;
BYTE result;
UINT16 initiator;
@ -1121,7 +1120,6 @@ BOOL mcs_recv_channel_join_confirm(rdpMcs* mcs, wStream* s, UINT16* channelId)
if (!mcs || !s || !channelId)
return FALSE;
status = TRUE;
MCSPDU = DomainMCSPDU_ChannelJoinConfirm;
if (!mcs_read_domain_mcspdu_header(s, &MCSPDU, &length))
return FALSE;

View File

@ -157,5 +157,5 @@ fail:
free(keyNames);
free(sectionNames);
IniFile_Free(ini);
return 0;
return rc;
}