diff options
author | Robert Watson <rwatson@FreeBSD.org> | 2002-10-28 19:16:44 +0000 |
---|---|---|
committer | Robert Watson <rwatson@FreeBSD.org> | 2002-10-28 19:16:44 +0000 |
commit | ee3bf1710ab76992275936a021ee7f8d4e1e49cd (patch) | |
tree | 09a9847f842dadb1c8fa4573a500857130b73771 /sys/security/mac_biba | |
parent | 8b3a843438920921b0636d71e0d0c2c7a7c6b261 (diff) | |
download | src-ee3bf1710ab76992275936a021ee7f8d4e1e49cd.tar.gz src-ee3bf1710ab76992275936a021ee7f8d4e1e49cd.zip |
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
Notes
Notes:
svn path=/head/; revision=106089
Diffstat (limited to 'sys/security/mac_biba')
-rw-r--r-- | sys/security/mac_biba/mac_biba.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/security/mac_biba/mac_biba.c b/sys/security/mac_biba/mac_biba.c index 9292a7306d67..5005843def20 100644 --- a/sys/security/mac_biba/mac_biba.c +++ b/sys/security/mac_biba/mac_biba.c @@ -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; |