libfreerdp-core: add more error handling.

This commit is contained in:
Vic Lee 2011-08-13 16:37:03 +08:00
parent e21a2688b5
commit 07b159a0c2
2 changed files with 14 additions and 3 deletions

View File

@ -58,6 +58,8 @@
boolean rdp_client_connect(rdpRdp* rdp) boolean rdp_client_connect(rdpRdp* rdp)
{ {
boolean ret;
rdp->settings->autologon = 1; rdp->settings->autologon = 1;
nego_init(rdp->nego); nego_init(rdp->nego);
@ -73,12 +75,16 @@ boolean rdp_client_connect(rdpRdp* rdp)
return False; return False;
} }
ret = False;
if (rdp->nego->selected_protocol & PROTOCOL_NLA) if (rdp->nego->selected_protocol & PROTOCOL_NLA)
transport_connect_nla(rdp->transport); ret = transport_connect_nla(rdp->transport);
else if (rdp->nego->selected_protocol & PROTOCOL_TLS) else if (rdp->nego->selected_protocol & PROTOCOL_TLS)
transport_connect_tls(rdp->transport); ret = transport_connect_tls(rdp->transport);
else if (rdp->nego->selected_protocol & PROTOCOL_RDP) else if (rdp->nego->selected_protocol & PROTOCOL_RDP)
transport_connect_rdp(rdp->transport); ret = transport_connect_rdp(rdp->transport);
if (!ret)
return False;
if (mcs_connect(rdp->mcs) != True) if (mcs_connect(rdp->mcs) != True)
{ {

View File

@ -438,6 +438,11 @@ static void rdp_process_fastpath_pdu(rdpRdp* rdp, STREAM* s)
uint16 length; uint16 length;
length = fastpath_read_header(rdp->fastpath, s); length = fastpath_read_header(rdp->fastpath, s);
if (length > stream_get_size(s))
{
printf("incorrect FastPath PDU header length %d\n", length);
return;
}
/* TODO: fipsInformation */ /* TODO: fipsInformation */