channels.c: Send the CHANNEL_OPTION_SHOW_PROTOCOL option only in client mode
authorMati Shabtay <matishabtay@gmail.com>
Mon, 8 Jul 2019 10:14:49 +0000 (13:14 +0300)
committerakallabeth <akallabeth@users.noreply.github.com>
Thu, 12 Dec 2019 10:10:44 +0000 (11:10 +0100)
According to MS-RDPBCGR section 2.2.1.3.4.1, this option should only be
sent as a client. If set by a server, mstsc will crash.

libfreerdp/core/channels.c

index e22ca8d..654b2ec 100644 (file)
@@ -94,7 +94,7 @@ BOOL freerdp_channel_send(rdpRdp* rdp, UINT16 channelId, const BYTE* data, int s
                        flags |= CHANNEL_FLAG_LAST;
                }
 
-               if ((channel->options & CHANNEL_OPTION_SHOW_PROTOCOL))
+               if (!rdp->settings->ServerMode && (channel->options & CHANNEL_OPTION_SHOW_PROTOCOL))
                {
                        flags |= CHANNEL_FLAG_SHOW_PROTOCOL;
                }