Merge pull request #5065 from akallabeth/tcp_connect_multi_fix

Fixed a possible NULL dereference.
This commit is contained in:
Bernhard Miklautz 2018-11-26 10:57:20 +00:00 committed by GitHub
commit 0b8010f8d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -960,11 +960,12 @@ static int freerdp_tcp_connect_multi(rdpContext* context, char** hostnames,
for (index = 0; index < count; index++)
{
if (peers[index].s == INVALID_SOCKET)
continue;
sockfd = peers[index].s;
addr = peers[index].addr;
if ((sockfd == INVALID_SOCKET) || (!addr))
continue;
/* blocking tcp connect */
status = _connect(sockfd, addr->ai_addr, addr->ai_addrlen);