[rdpdr] filter empty device announce

This commit is contained in:
Armin Novak 2022-12-22 10:16:11 +01:00 committed by David Fort
parent b988e8fba7
commit 318b55adc1
2 changed files with 9 additions and 1 deletions

View File

@ -165,6 +165,9 @@ static UINT rdpdr_send_device_list_remove_request(rdpdrPlugin* rdpdr, UINT32 cou
WINPR_ASSERT(rdpdr);
WINPR_ASSERT(ids || (count == 0));
if (count == 0)
return CHANNEL_RC_OK;
s = StreamPool_Take(rdpdr->pool, count * sizeof(UINT32) + 8);
if (!s)
@ -1330,6 +1333,11 @@ static UINT rdpdr_send_device_list_announce_request(rdpdrPlugin* rdpdr, BOOL use
if (!device_foreach(rdpdr, TRUE, device_announce, &arg))
return ERROR_INVALID_DATA;
if (arg.count == 0)
{
Stream_Release(s);
return CHANNEL_RC_OK;
}
pos = Stream_GetPosition(s);
Stream_SetPosition(s, count_pos);
Stream_Write_UINT32(s, arg.count);

View File

@ -1235,7 +1235,7 @@ BOOL pf_channel_rdpdr_client_handle(pClientContext* pc, UINT16 channelId, const
}
break;
#else
return pf_channel_rdpdr_client_send_to_server(ps, s);
return pf_channel_rdpdr_client_send_to_server(rdpdr, ps, s);
#endif
default:
WLog_ERR(TAG,