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:
parent
a09ac92281
commit
d7fc1b7da4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user