libfreerdp/core: transport_write unchecked parameters

transport_write did not check if transport or bio are
set. The transport read checks it. In using fastpath
and for example a mouse input is sent, the transport
is never checked and can cause a segfault.
This commit is contained in:
Martin Haimberger 2016-08-22 02:17:11 -07:00
parent 5b2455f314
commit e9e0764ace

View File

@ -657,6 +657,15 @@ int transport_write(rdpTransport* transport, wStream* s)
int status = -1;
int writtenlength = 0;
if (!transport)
return -1;
if (!transport->frontBio)
{
transport->layer = TRANSPORT_LAYER_CLOSED;
return -1;
}
EnterCriticalSection(&(transport->WriteLock));
length = Stream_GetPosition(s);