summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorasomers <asomers@FreeBSD.org>2017-04-28 14:45:03 +0000
committerasomers <asomers@FreeBSD.org>2017-04-28 14:45:03 +0000
commitb3b1b797011f52efb93e05eb5089df6e53c2277a (patch)
tree742235a2560405136af5e1e07a90f50d81b5f425
parent88c95c3a98f96b1976bf7a590e19eba556faa588 (diff)
downloadFreeBSD-src-b3b1b797011f52efb93e05eb5089df6e53c2277a.zip
FreeBSD-src-b3b1b797011f52efb93e05eb5089df6e53c2277a.tar.gz
MFC r316610:
usr.bin/netstat: strcpy -> strlcpy Reported by: Coverity CID: 1006741, 1006744 Sponsored by: Spectra Logic Corp
-rw-r--r--usr.bin/netstat/inet6.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c
index e62eeac..24e2b88 100644
--- a/usr.bin/netstat/inet6.c
+++ b/usr.bin/netstat/inet6.c
@@ -618,7 +618,7 @@ ip6_ifstats(char *ifname)
return;
}
- strcpy(ifr.ifr_name, ifname);
+ strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
if (ioctl(s, SIOCGIFSTAT_IN6, (char *)&ifr) < 0) {
if (errno != EPFNOSUPPORT)
xo_warn("Warning: ioctl(SIOCGIFSTAT_IN6)");
@@ -1079,7 +1079,7 @@ icmp6_ifstats(char *ifname)
return;
}
- strcpy(ifr.ifr_name, ifname);
+ strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name));
if (ioctl(s, SIOCGIFSTAT_ICMP6, (char *)&ifr) < 0) {
if (errno != EPFNOSUPPORT)
xo_warn("Warning: ioctl(SIOCGIFSTAT_ICMP6)");
OpenPOWER on IntegriCloud