mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
Zero the trusted_interface buffer before starting parsing.
Print a warning if a requested interface name is longer than IFNAMSIZ. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
This commit is contained in:
parent
8b3a843438
commit
ee3bf1710a
1 changed files with 6 additions and 0 deletions
|
|
@ -1159,6 +1159,7 @@ mac_biba_create_ifnet(struct ifnet *ifnet, struct label *ifnetlabel)
|
|||
!strvalid(trusted_interfaces, sizeof(trusted_interfaces)))
|
||||
goto set;
|
||||
|
||||
bzero(tiflist, sizeof(tiflist));
|
||||
for (p = trusted_interfaces, q = tiflist; *p != '\0'; p++, q++)
|
||||
if(*p != ' ' && *p != '\t')
|
||||
*q = *p;
|
||||
|
|
@ -1175,6 +1176,11 @@ mac_biba_create_ifnet(struct ifnet *ifnet, struct label *ifnetlabel)
|
|||
grade = MAC_BIBA_TYPE_HIGH;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
*p = '\0';
|
||||
printf("mac_biba warning: interface name "
|
||||
"\"%s\" is too long (must be < %d)\n",
|
||||
q, IFNAMSIZ);
|
||||
}
|
||||
if (*p == '\0')
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue