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

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);