From owner-cvs-usrbin Mon Jun 8 21:19:17 1998 Return-Path: Received: (from daemon@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA23036 for cvs-usrbin-outgoing; Mon, 8 Jun 1998 21:19:17 -0700 (PDT) (envelope-from owner-cvs-usrbin) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA22990; Mon, 8 Jun 1998 21:19:06 -0700 (PDT) (envelope-from imp@FreeBSD.org) From: Warner Losh Received: (from imp@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id VAA16878; Mon, 8 Jun 1998 21:17:42 -0700 (PDT) Date: Mon, 8 Jun 1998 21:17:42 -0700 (PDT) Message-Id: <199806090417.VAA16878@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-usrbin@FreeBSD.ORG Subject: cvs commit: src/usr.bin/systat disks.c iostat.c main.c mbufs.c netstat.c pigs.c swap.c vmstat.c Sender: owner-cvs-usrbin@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk imp 1998/06/08 21:17:42 PDT Modified files: usr.bin/systat disks.c iostat.c main.c mbufs.c netstat.c pigs.c swap.c vmstat.c Log: o Use snprintf rather than sprintf o Add more checks for buffer overflows o Use snprintf rather than strcat/cpy and have better checks for max length exceeded. Most of these changes are not exploitable buffer overruns, but it never hurts to be safe. Inspired by and obtained from: OpenBSD Revision Changes Path 1.7 +4 -2 src/usr.bin/systat/disks.c 1.4 +1 -1 src/usr.bin/systat/iostat.c 1.8 +2 -2 src/usr.bin/systat/main.c 1.7 +3 -3 src/usr.bin/systat/mbufs.c 1.9 +8 -6 src/usr.bin/systat/netstat.c 1.6 +1 -1 src/usr.bin/systat/pigs.c 1.6 +10 -5 src/usr.bin/systat/swap.c 1.25 +3 -3 src/usr.bin/systat/vmstat.c