summaryrefslogtreecommitdiffstats
path: root/sys/security
diff options
context:
space:
mode:
authorcsjp <csjp@FreeBSD.org>2006-01-15 01:02:20 +0000
committercsjp <csjp@FreeBSD.org>2006-01-15 01:02:20 +0000
commitd7fc1b7da4963321e9533aca360058014bec25e2 (patch)
tree6243dfb3a7e3dca04a0206f32193e9a8808a4856 /sys/security
parenta09ac922819857c1d4dfd396b34c57bf409178d8 (diff)
downloadFreeBSD-src-d7fc1b7da4963321e9533aca360058014bec25e2.zip
FreeBSD-src-d7fc1b7da4963321e9533aca360058014bec25e2.tar.gz
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)
Diffstat (limited to 'sys/security')
-rw-r--r--sys/security/mac_bsdextended/mac_bsdextended.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/security/mac_bsdextended/mac_bsdextended.c b/sys/security/mac_bsdextended/mac_bsdextended.c
index 39b3a59..512c19a 100644
--- a/sys/security/mac_bsdextended/mac_bsdextended.c
+++ b/sys/security/mac_bsdextended/mac_bsdextended.c
@@ -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;
OpenPOWER on IntegriCloud