diff options
author | archie <archie@FreeBSD.org> | 1998-12-04 22:54:57 +0000 |
---|---|---|
committer | archie <archie@FreeBSD.org> | 1998-12-04 22:54:57 +0000 |
commit | 982e80577dd08945aa2345ebe35e3f50eef9eb48 (patch) | |
tree | e21ff4cbfbcb4097c6cc444d68ddd9a3fd37837f /sys/alpha/pci/cia.c | |
parent | 707b8f68aa118c7396f2a2633751e32477d9ed08 (diff) | |
download | FreeBSD-src-982e80577dd08945aa2345ebe35e3f50eef9eb48.zip FreeBSD-src-982e80577dd08945aa2345ebe35e3f50eef9eb48.tar.gz |
Examine all occurrences of sprintf(), strcat(), and str[n]cpy()
for possible buffer overflow problems. Replaced most sprintf()'s
with snprintf(); for others cases, added terminating NUL bytes where
appropriate, replaced constants like "16" with sizeof(), etc.
These changes include several bug fixes, but most changes are for
maintainability's sake. Any instance where it wasn't "immediately
obvious" that a buffer overflow could not occur was made safer.
Reviewed by: Bruce Evans <bde@zeta.org.au>
Reviewed by: Matthew Dillon <dillon@apollo.backplane.com>
Reviewed by: Mike Spengler <mks@networkcs.com>
Diffstat (limited to 'sys/alpha/pci/cia.c')
-rw-r--r-- | sys/alpha/pci/cia.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/alpha/pci/cia.c b/sys/alpha/pci/cia.c index 41769ea..c68ef57 100644 --- a/sys/alpha/pci/cia.c +++ b/sys/alpha/pci/cia.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: cia.c,v 1.12 1998/11/28 09:55:16 dfr Exp $ + * $Id: cia.c,v 1.13 1998/12/02 09:33:27 dfr Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -804,13 +804,13 @@ cia_attach(device_t dev) set_iointr(alpha_dispatch_intr); if (cia_ispyxis) { - strcpy(chipset_type, "pyxis"); + snprintf(chipset_type, sizeof(chipset_type), "pyxis"); chipset_bwx = 1; chipset_ports = CIA_EV56_BWIO; chipset_memory = CIA_EV56_BWMEM; chipset_dense = CIA_PCI_DENSE; } else { - strcpy(chipset_type, "cia"); + snprintf(chipset_type, sizeof(chipset_type), "cia"); chipset_bwx = 0; chipset_ports = CIA_PCI_SIO1; chipset_memory = CIA_PCI_SMEM1; |