On Thu, Jan 21, 2016 at 04:11:20PM +0000, Hartmut Brandt wrote: > Author: harti > Date: Thu Jan 21 16:11:20 2016 > New Revision: 294507 > URL: https://svnweb.freebsd.org/changeset/base/294507 > > Log: > Fill the ifAlias leaf of the ifXTable with the interface description > if there is one available and it fits into the maximum size (64 characters). > > Modified: > head/contrib/bsnmp/snmp_mibII/mibII.c > head/contrib/bsnmp/snmp_mibII/mibII.h > head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c > > Modified: head/contrib/bsnmp/snmp_mibII/mibII.c > ============================================================================== > --- head/contrib/bsnmp/snmp_mibII/mibII.c Thu Jan 21 15:27:44 2016 > (r294506) > +++ head/contrib/bsnmp/snmp_mibII/mibII.c Thu Jan 21 16:11:20 2016 > (r294507) > @@ -443,6 +443,7 @@ mib_fetch_ifmib(struct mibif *ifp) > size_t len; > void *newmib; > struct ifmibdata oldmib = ifp->mib; > + struct ifreq irr; > > if (fetch_generic_mib(ifp, &oldmib) == -1) > return (-1); > @@ -514,6 +515,18 @@ mib_fetch_ifmib(struct mibif *ifp) > } > > out: > + strncpy(irr.ifr_name, ifp->name, sizeof(irr.ifr_name));
Why not strlcpy? You're not forcing null termination here, so there could be issues. Thanks, -- Shawn Webb HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE
signature.asc
Description: PGP signature