reds: lookup corresponding channel id

In reds_send_link_ack(), lookup the channel with the same id as the link
message.

The bug was found during code review a while ago.

A reproducer bug was later reported:
https://bugzilla.redhat.com/show_bug.cgi?id=1058625
This commit is contained in:
Marc-André Lureau 2013-11-18 11:28:25 +01:00
parent 5972452b28
commit a434543eb1

View File

@ -1342,7 +1342,8 @@ static int reds_send_link_ack(RedLinkInfo *link)
ack.error = SPICE_LINK_ERR_OK;
channel = reds_find_channel(link->link_mess->channel_type, 0);
channel = reds_find_channel(link->link_mess->channel_type,
link->link_mess->channel_id);
if (!channel) {
spice_assert(link->link_mess->channel_type == SPICE_CHANNEL_MAIN);
spice_assert(reds->main_channel);