diff --git a/libfreerdp/core/rdp.c b/libfreerdp/core/rdp.c index 655b017af..689c738b4 100644 --- a/libfreerdp/core/rdp.c +++ b/libfreerdp/core/rdp.c @@ -2047,7 +2047,7 @@ static state_run_t rdp_recv_callback_int(rdpTransport* transport, wStream* s, vo case CONNECTION_STATE_MULTITRANSPORT_BOOTSTRAPPING_REQUEST: if (!rdp_client_connect_auto_detect(rdp, s)) { - rdp_client_transition_to_state( + (void)rdp_client_transition_to_state( rdp, CONNECTION_STATE_CAPABILITIES_EXCHANGE_DEMAND_ACTIVE); status = STATE_RUN_TRY_AGAIN; } diff --git a/libfreerdp/emu/scard/smartcard_virtual_gids.c b/libfreerdp/emu/scard/smartcard_virtual_gids.c index 9e0e8d53f..a81569a3b 100644 --- a/libfreerdp/emu/scard/smartcard_virtual_gids.c +++ b/libfreerdp/emu/scard/smartcard_virtual_gids.c @@ -1257,8 +1257,8 @@ static BOOL vgids_ins_perform_security_operation(vgidsContext* context, wStream* if (!context->commandData) return FALSE; } - else - Stream_EnsureRemainingCapacity(context->commandData, lc); + else if (!Stream_EnsureRemainingCapacity(context->commandData, lc)) + return FALSE; Stream_Write(context->commandData, Stream_Pointer(s), lc); Stream_SealLength(context->commandData); diff --git a/server/Sample/sfreerdp.c b/server/Sample/sfreerdp.c index b7d29c905..e64fbcccc 100644 --- a/server/Sample/sfreerdp.c +++ b/server/Sample/sfreerdp.c @@ -659,7 +659,8 @@ static DWORD WINAPI tf_debug_channel_thread_func(LPVOID arg) if (BytesReturned == 0) break; - Stream_EnsureRemainingCapacity(s, BytesReturned); + if (!Stream_EnsureRemainingCapacity(s, BytesReturned)) + break; if (WTSVirtualChannelRead(context->debug_channel, 0, (PCHAR)Stream_Buffer(s), (ULONG)Stream_Capacity(s), &BytesReturned) == FALSE)