]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r299873
authortruckman <truckman@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 20 May 2016 07:14:03 +0000 (07:14 +0000)
committertruckman <truckman@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 20 May 2016 07:14:03 +0000 (07:14 +0000)
commit4a01250ed10e676573c21c143c958d61c2f7994e
tree3e038bc7fe446feadcd22c7c9f50fd13b9c32a55
parentc31bd1da4c60daeb9fd30b1c951c251920147dc5
MFC r299873

Use strlcpy() instead of strncpy() when copying ifname to ensure
that it is NUL terminated.  Additional NUL padding is not required
for short names.

Use sizeof(destination) in a few places instead of IFNAMSIZ.

Cast afp->af_ridreq and afp->af_addreq  to make the intent of
the code more obvious.

Reported by: Coverity
CID: 1009628100963010096311009632100963310096351009638
CID: 1009639100964010096411009642100964310096441009645
CID: 1009646100964710100491010050101005110100521010053
CID: 1010054101129310112941011295101129610112971011298
CID: 1011299130582113517201351721

git-svn-id: svn://svn.freebsd.org/base/stable/10@300285 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sbin/ifconfig/af_inet.c
sbin/ifconfig/af_inet6.c
sbin/ifconfig/af_nd6.c
sbin/ifconfig/ifclone.c
sbin/ifconfig/ifconfig.c
sbin/ifconfig/iffib.c
sbin/ifconfig/ifgre.c
sbin/ifconfig/ifieee80211.c
sbin/ifconfig/ifmac.c
sbin/ifconfig/ifmedia.c