summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorasomers <asomers@FreeBSD.org>2017-05-30 22:35:36 +0000
committerasomers <asomers@FreeBSD.org>2017-05-30 22:35:36 +0000
commite9717afe8ac57d3fc86af3f8dbfa5349cbedee0b (patch)
treee03b95f63a100cc6963c3bcaf7109d997db1a2f7 /usr.bin
parentce27be0a2991a4160c742ef4bc55d4a7fec200a0 (diff)
downloadFreeBSD-src-e9717afe8ac57d3fc86af3f8dbfa5349cbedee0b.zip
FreeBSD-src-e9717afe8ac57d3fc86af3f8dbfa5349cbedee0b.tar.gz
MFC r316610:
usr.bin/netstat: strcpy -> strlcpy Reported by: Coverity CID: 1006741, 1006744 Sponsored by: Spectra Logic Corp
Diffstat (limited to 'usr.bin')
-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 4e175fc..0f41e75 100644
--- a/usr.bin/netstat/inet6.c
+++ b/usr.bin/netstat/inet6.c
@@ -527,7 +527,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)
perror("Warning: ioctl(SIOCGIFSTAT_IN6)");
@@ -921,7 +921,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)
perror("Warning: ioctl(SIOCGIFSTAT_ICMP6)");
OpenPOWER on IntegriCloud