1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

o IFNAMSIZ includes a terminating null byte.

Submitted by:	rdivacky
MFC after:	1 week
This commit is contained in:
Maxim Konovalov 2007-04-14 16:09:23 +00:00
parent 95998e0b3b
commit fd31a32a65
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=168726

View File

@ -868,7 +868,7 @@ diagif_fetch_vcc(struct diagif *aif, int fd)
return;
strncpy(ifr.ifr_name, aif->ifname, IFNAMSIZ);
ifr.ifr_name[IFNAMSIZ] = '\0';
ifr.ifr_name[IFNAMSIZ - 1] = '\0';
aif->vtab = malloc(sizeof(*aif->vtab) + sizeof(aif->vtab->vccs[0]) *
aif->mib.max_vccs);