[MPlayer-cvslog] r36356 - trunk/stream/tcp.c
al
subversion at mplayerhq.hu
Fri Jul 12 00:08:33 CEST 2013
Author: al
Date: Fri Jul 12 00:08:33 2013
New Revision: 36356
Log:
stream/tcp: Check that host object has the right AF before connect
Avoid trying bogus IPv6 adresses on systems that only
have gethostbyname function. Currently we would copy the
IPv4 address into the first part of the IPv6 and then try
to connect to that. The connection attempt can take a long
time.
Tested-by: Erik Auerswald >auerswal unix-ag uni-kl de<
Patch-by: >aplattner nvidia com<
Modified:
trunk/stream/tcp.c
Modified: trunk/stream/tcp.c
==============================================================================
--- trunk/stream/tcp.c Thu Jul 11 17:27:32 2013 (r36355)
+++ trunk/stream/tcp.c Fri Jul 12 00:08:33 2013 (r36356)
@@ -160,6 +160,8 @@ connect2Server_with_af(char *host, int p
return TCP_ERROR_FATAL;
}
+ if (af != hp->h_addrtype) return TCP_ERROR_FATAL;
+
memcpy( our_s_addr, hp->h_addr_list[0], hp->h_length );
}
#if HAVE_WINSOCK2_H
More information about the MPlayer-cvslog
mailing list