[MPlayer-cvslog] r29393 - trunk/stream/tcp.c

reimar subversion at mplayerhq.hu
Fri Jun 26 15:54:22 CEST 2009


Author: reimar
Date: Fri Jun 26 15:54:22 2009
New Revision: 29393

Log:
Replace incorrect use of strncpy by av_strlcpy.
Only a real issue if inet_ntoa can actually return a string of more than 255 bytes.

Modified:
   trunk/stream/tcp.c

Modified: trunk/stream/tcp.c
==============================================================================
--- trunk/stream/tcp.c	Fri Jun 26 15:41:01 2009	(r29392)
+++ trunk/stream/tcp.c	Fri Jun 26 15:54:22 2009	(r29393)
@@ -33,6 +33,7 @@
 #include "network.h"
 #include "stream.h"
 #include "tcp.h"
+#include "libavutil/avstring.h"
 
 /* IPv6 options */
 int   network_prefer_ipv4 = 0;
@@ -163,7 +164,7 @@ connect2Server_with_af(char *host, int p
 	}
 
 #if HAVE_INET_ATON || defined(HAVE_WINSOCK2_H)
-	strncpy( buf, inet_ntoa( *((struct in_addr*)our_s_addr) ), 255);
+	av_strlcpy( buf, inet_ntoa( *((struct in_addr*)our_s_addr) ), 255);
 #else
 	inet_ntop(af, our_s_addr, buf, 255);
 #endif


More information about the MPlayer-cvslog mailing list