From b62f2da08ffbdee21d7980061668c65fbfc23146 Mon Sep 17 00:00:00 2001 From: delphij Date: Sun, 8 Jan 2017 07:25:22 +0000 Subject: MFC r311392: Use strlcpy and snprintf in netstat(1). Expand inet6name() line buffer to NI_MAXHOST and use strlcpy/snprintf in various places. Reported by: Anton Yuzhaninov --- usr.bin/netstat/unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'usr.bin/netstat/unix.c') diff --git a/usr.bin/netstat/unix.c b/usr.bin/netstat/unix.c index 29668a4..b8cddc8 100644 --- a/usr.bin/netstat/unix.c +++ b/usr.bin/netstat/unix.c @@ -75,7 +75,7 @@ pcblist_sysctl(int type, char **bufp) size_t len; char mibvar[sizeof "net.local.seqpacket.pcblist"]; - sprintf(mibvar, "net.local.%s.pcblist", socktype[type]); + snprintf(mibvar, sizeof(mibvar), "net.local.%s.pcblist", socktype[type]); len = 0; if (sysctlbyname(mibvar, 0, &len, 0, 0) < 0) { -- cgit v1.1