Unsafe use of strncpy replaced by strlcpy. CID 2254.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40630 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jonas Sundström 2011-02-23 01:06:58 +00:00
parent d1a78f51e0
commit 41e4f0903d

View File

@ -381,7 +381,7 @@ HINF * gethostpoop (name, numeric)
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 */