]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use strlcpy() instead of strncpy() when copying ifname to ensure
authortruckman <truckman@FreeBSD.org>
Mon, 16 May 2016 00:25:24 +0000 (00:25 +0000)
committertruckman <truckman@FreeBSD.org>
Mon, 16 May 2016 00:25:24 +0000 (00:25 +0000)
commit4d196a467d42ebc70eeb0b7276fcfe350b5570de
tree1076cbb0355b5f48b1303d093d224e97b4e9c118
parente8e4b22eec2adbe7819b85eec780b5e5413ebef9
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
MFC after: 1 week
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