summaryrefslogtreecommitdiffstats
path: root/contrib/bsnmp
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2017-01-07 08:54:02 +0000
committerngie <ngie@FreeBSD.org>2017-01-07 08:54:02 +0000
commitb735cb7edadcdc14bb6aa4ef1157f876dbefe7fe (patch)
tree1292983d442a9d9c73f9a4c237f85603afd8694b /contrib/bsnmp
parente7482bc1d4714d175bbbf7b05a49997db377de97 (diff)
downloadFreeBSD-src-b735cb7edadcdc14bb6aa4ef1157f876dbefe7fe.zip
FreeBSD-src-b735cb7edadcdc14bb6aa4ef1157f876dbefe7fe.tar.gz
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
Diffstat (limited to 'contrib/bsnmp')
-rw-r--r--contrib/bsnmp/snmp_mibII/mibII.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/bsnmp/snmp_mibII/mibII.c b/contrib/bsnmp/snmp_mibII/mibII.c
index a105398..85c61d5 100644
--- a/contrib/bsnmp/snmp_mibII/mibII.c
+++ b/contrib/bsnmp/snmp_mibII/mibII.c
@@ -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 *name)
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;
OpenPOWER on IntegriCloud