[haiku-commits] r40630 - haiku/trunk/src/bin/network/netcat
- From: jonas@xxxxxxxxxxx
- To: haiku-commits@xxxxxxxxxxxxx
- Date: Wed, 23 Feb 2011 02:06:58 +0100 (CET)
Author: kirilla
Date: 2011-02-23 02:06:58 +0100 (Wed, 23 Feb 2011)
New Revision: 40630
Changeset: http://dev.haiku-os.org/changeset/40630
Modified:
haiku/trunk/src/bin/network/netcat/netcat.c
Log:
Unsafe use of strncpy replaced by strlcpy. CID 2254.
Modified: haiku/trunk/src/bin/network/netcat/netcat.c
===================================================================
--- haiku/trunk/src/bin/network/netcat/netcat.c 2011-02-23 00:55:44 UTC (rev
40629)
+++ haiku/trunk/src/bin/network/netcat/netcat.c 2011-02-23 01:06:58 UTC (rev
40630)
@@ -381,7 +381,7 @@
strncpy (poop->name, hostent->h_name, MAXHOSTNAMELEN - 2);
for (x = 0; hostent->h_addr_list[x] && (x < 8); x++) {
memcpy (&poop->iaddrs[x], hostent->h_addr_list[x], sizeof (IA));
- strncpy (poop->addrs[x], inet_ntoa (poop->iaddrs[x]),
+ strlcpy (poop->addrs[x], inet_ntoa (poop->iaddrs[x]),
sizeof (poop->addrs[0]));
} /* for x -> addrs, part A */
if (! o_verbose) /* if we didn't want to see the */
Other related posts: