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:
@@ -381,7 +381,7 @@ HINF * gethostpoop (name, numeric)
|
|||||||
strncpy (poop->name, hostent->h_name, MAXHOSTNAMELEN - 2);
|
strncpy (poop->name, hostent->h_name, MAXHOSTNAMELEN - 2);
|
||||||
for (x = 0; hostent->h_addr_list[x] && (x < 8); x++) {
|
for (x = 0; hostent->h_addr_list[x] && (x < 8); x++) {
|
||||||
memcpy (&poop->iaddrs[x], hostent->h_addr_list[x], sizeof (IA));
|
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]));
|
sizeof (poop->addrs[0]));
|
||||||
} /* for x -> addrs, part A */
|
} /* for x -> addrs, part A */
|
||||||
if (! o_verbose) /* if we didn't want to see the */
|
if (! o_verbose) /* if we didn't want to see the */
|
||||||
|
|||||||
Reference in New Issue
Block a user