svn commit: r311599 - stable/11/contrib/bsnmp/snmp_mibII
Ngie Cooper
ngie at FreeBSD.org
Sat Jan 7 08:54:03 UTC 2017
Author: ngie
Date: Sat Jan 7 08:54:02 2017
New Revision: 311599
URL: https://svnweb.freebsd.org/changeset/base/311599
Log:
MFC r310952:
MIB-II: use strlcpy instead of strcpy when copying {descr,name}
This is of course to avoid buffer overruns
The remaining strcpy instance in the module needs to be audited for
correctness
CID: 1006827, 1006828
Modified:
stable/11/contrib/bsnmp/snmp_mibII/mibII.c
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/contrib/bsnmp/snmp_mibII/mibII.c
==============================================================================
--- stable/11/contrib/bsnmp/snmp_mibII/mibII.c Sat Jan 7 08:53:58 2017 (r311598)
+++ stable/11/contrib/bsnmp/snmp_mibII/mibII.c Sat Jan 7 08:54:02 2017 (r311599)
@@ -204,7 +204,7 @@ mib_if_set_dyn(const char *name)
return;
if ((d = malloc(sizeof(*d))) == NULL)
err(1, NULL);
- strcpy(d->name, name);
+ strlcpy(d->name, name, sizeof(d->name));
SLIST_INSERT_HEAD(&mibdynif_list, d, link);
}
@@ -774,8 +774,8 @@ mibif_create(u_int sysindex, const char
memset(ifp->private, 0, sizeof(struct mibif_private));
ifp->sysindex = sysindex;
- strcpy(ifp->name, name);
- strcpy(ifp->descr, name);
+ strlcpy(ifp->name, name, sizeof(ifp->name));
+ strlcpy(ifp->descr, name, sizeof(ifp->descr));
ifp->spec_oid = oid_zeroDotZero;
map = NULL;
More information about the svn-src-stable
mailing list