summaryrefslogtreecommitdiffstats
path: root/sys/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sys/pci')
-rw-r--r--sys/pci/if_en_pci.c2
-rw-r--r--sys/pci/isp_pci.c2
-rw-r--r--sys/pci/ncr.c6
-rw-r--r--sys/pci/pci_compat.c3
-rw-r--r--sys/pci/pcisupport.c8
5 files changed, 12 insertions, 9 deletions
diff --git a/sys/pci/if_en_pci.c b/sys/pci/if_en_pci.c
index d1853b5..37db78e 100644
--- a/sys/pci/if_en_pci.c
+++ b/sys/pci/if_en_pci.c
@@ -259,7 +259,7 @@ int unit;
enpcis[unit] = scp; /* lock it in */
en_cd.cd_devs[unit] = sc; /* fake a cfdriver structure */
en_cd.cd_ndevs = NEN;
- sprintf(sc->sc_dev.dv_xname, "en%d", unit);
+ snprintf(sc->sc_dev.dv_xname, sizeof(sc->sc_dev.dv_xname), "en%d", unit);
sc->enif.if_unit = unit;
sc->enif.if_name = "en";
diff --git a/sys/pci/isp_pci.c b/sys/pci/isp_pci.c
index ae7842b..f22cfe1 100644
--- a/sys/pci/isp_pci.c
+++ b/sys/pci/isp_pci.c
@@ -270,7 +270,7 @@ isp_pci_attach(config_id, unit)
pcs->pci_st == IO_SPACE_MAPPING? "I/O" : "Memory");
isp = &pcs->pci_isp;
- (void) sprintf(isp->isp_name, "isp%d", unit);
+ (void) snprintf(isp->isp_name, sizeof(isp->isp_name), "isp%d", unit);
isp->isp_osinfo.unit = unit;
data = pci_conf_read(config_id, PCI_ID_REG);
diff --git a/sys/pci/ncr.c b/sys/pci/ncr.c
index 3703322..0171ba9 100644
--- a/sys/pci/ncr.c
+++ b/sys/pci/ncr.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: ncr.c,v 1.136 1998/09/29 09:14:52 bde Exp $
+** $Id: ncr.c,v 1.137 1998/10/15 23:17:49 gibbs Exp $
**
** Device driver for the NCR 53C8XX PCI-SCSI-Controller Family.
**
@@ -1357,7 +1357,7 @@ static void ncr_attach (pcici_t tag, int unit);
static char ident[] =
- "\n$Id: ncr.c,v 1.136 1998/09/29 09:14:52 bde Exp $\n";
+ "\n$Id: ncr.c,v 1.137 1998/10/15 23:17:49 gibbs Exp $\n";
static const u_long ncr_version = NCR_VERSION * 11
+ (u_long) sizeof (struct ncb) * 7
@@ -1410,7 +1410,7 @@ DATA_SET (pcidevice_set, ncr_device);
static char *ncr_name (ncb_p np)
{
static char name[10];
- sprintf(name, "ncr%d", np->unit);
+ snprintf(name, sizeof(name), "ncr%d", np->unit);
return (name);
}
diff --git a/sys/pci/pci_compat.c b/sys/pci/pci_compat.c
index d2f9ebf..9048953 100644
--- a/sys/pci/pci_compat.c
+++ b/sys/pci/pci_compat.c
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: pci_compat.c,v 1.12 1998/10/06 14:18:40 dfr Exp $
+ * $Id: pci_compat.c,v 1.13 1998/11/09 08:03:01 peter Exp $
*
*/
@@ -427,6 +427,7 @@ pci_drvattach(struct pci_devinfo *dinfo)
else
strncpy(dinfo->conf.pd_name, "????",
sizeof(dinfo->conf.pd_name));
+ dinfo->conf.pd_name[sizeof(dinfo->conf.pd_name) - 1] = 0;
dinfo->conf.pd_unit = unit;
diff --git a/sys/pci/pcisupport.c b/sys/pci/pcisupport.c
index a422972..6a46960 100644
--- a/sys/pci/pcisupport.c
+++ b/sys/pci/pcisupport.c
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** $Id: pcisupport.c,v 1.74 1998/11/26 21:57:52 n_hibma Exp $
+** $Id: pcisupport.c,v 1.75 1998/12/01 21:50:58 sos Exp $
**
** Device driver for DEC/INTEL PCI chipsets.
**
@@ -102,10 +102,12 @@ generic_pci_bridge (pcici_t tag)
case 5: strcpy(tmpbuf, "PCI to PCMCIA"); break;
case 7: strcpy(tmpbuf, "PCI to CardBus"); break;
default:
- sprintf(tmpbuf, "PCI to 0x%x", classreg>>16 & 0xff);
+ snprintf(tmpbuf, sizeof(tmpbuf),
+ "PCI to 0x%x", classreg>>16 & 0xff);
break;
}
- sprintf(tmpbuf+strlen(tmpbuf), " bridge (vendor=%04x device=%04x)",
+ snprintf(tmpbuf+strlen(tmpbuf), sizeof(tmpbuf)-strlen(tmpbuf),
+ " bridge (vendor=%04x device=%04x)",
id & 0xffff, (id >> 16) & 0xffff);
descr = malloc (strlen(tmpbuf) +1, M_DEVBUF, M_WAITOK);
strcpy(descr, tmpbuf);
OpenPOWER on IntegriCloud