(trunk, libT) #5157 'check valid address before UTP_Create()' -- added.

This commit is contained in:
Jordan Lee 2012-12-05 23:48:00 +00:00
parent ccb4a16ab8
commit 61c1f7efec
1 changed files with 4 additions and 0 deletions

View File

@ -302,6 +302,10 @@ tr_netOpenPeerUTPSocket (tr_session * session,
{
struct sockaddr_storage ss;
socklen_t sslen;
if (!tr_address_is_valid_for_peers (addr, port))
return -EINVAL;
sslen = setup_sockaddr (addr, port, &ss);
return UTP_Create (tr_utpSendTo, (void*)session,