Fixed crash caused by trying to cast and dereference a NULL hChannel.

This commit is contained in:
Mike McDonald 2014-11-07 18:06:14 -05:00
parent 95a72a182c
commit 7d5963a1e6

View File

@ -123,13 +123,16 @@ static int freerdp_peer_virtual_channel_write(freerdp_peer* client, HANDLE hChan
UINT32 chunkSize;
UINT32 maxChunkSize;
UINT32 totalLength;
rdpPeerChannel* peerChannel;
rdpMcsChannel* mcsChannel;
rdpRdp* rdp = client->context->rdp;
rdpPeerChannel* peerChannel = (rdpPeerChannel*) hChannel;
rdpMcsChannel* mcsChannel = peerChannel->mcsChannel;
if (!hChannel)
return -1;
peerChannel = (rdpPeerChannel*) hChannel;
mcsChannel = peerChannel->mcsChannel;
if (peerChannel->channelFlags & WTS_CHANNEL_OPTION_DYNAMIC)
return -1; /* not yet supported */