Fix potential overrun of static stack allocated array which stores

the rules. If an array is N elements large, we can only access
elements 0..(N-1).

MFC after:	1 week
Found with:	Coverity Prevent(tm)
This commit is contained in:
csjp 2006-01-15 01:02:20 +00:00
parent a09ac92281
commit d7fc1b7da4

View File

@ -150,7 +150,7 @@ sysctl_rule(SYSCTL_HANDLER_ARGS)
return (EINVAL);
index = name[0];
if (index > MAC_BSDEXTENDED_MAXRULES)
if (index >= MAC_BSDEXTENDED_MAXRULES)
return (ENOENT);
ruleptr = NULL;