summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2009-05-28 07:20:52 +0000
committertrasz <trasz@FreeBSD.org>2009-05-28 07:20:52 +0000
commit7449a8ffdf985258921afef4fed9c58fd370b9c3 (patch)
tree6f20ccf49ff2efe8ff781ba8c2f4a3e2300ebdef /lib/libc
parent6d68011290a6156f9221c2fbc75599f7502907f3 (diff)
downloadFreeBSD-src-7449a8ffdf985258921afef4fed9c58fd370b9c3.zip
FreeBSD-src-7449a8ffdf985258921afef4fed9c58fd370b9c3.tar.gz
Fix off by one error in acl_create_entry(3).
Reviewed by: rwatson@ MFC after: 2 weeks
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/posix1e/acl_entry.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libc/posix1e/acl_entry.c b/lib/libc/posix1e/acl_entry.c
index aaef611..407aff1 100644
--- a/lib/libc/posix1e/acl_entry.c
+++ b/lib/libc/posix1e/acl_entry.c
@@ -51,7 +51,12 @@ acl_create_entry(acl_t *acl_p, acl_entry_t *entry_p)
acl_int = &(*acl_p)->ats_acl;
- if ((acl_int->acl_cnt >= ACL_MAX_ENTRIES) || (acl_int->acl_cnt < 0)) {
+ /*
+ * +1, because we are checking if there is space left for one more
+ * entry.
+ */
+ if ((acl_int->acl_cnt + 1 >= ACL_MAX_ENTRIES) ||
+ (acl_int->acl_cnt < 0)) {
errno = EINVAL;
return (-1);
}
OpenPOWER on IntegriCloud