mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Fix off by one error in acl_create_entry(3).
Reviewed by: rwatson@ MFC after: 2 weeks
This commit is contained in:
parent
b78ddb0b8a
commit
60a8b6022d
1 changed files with 6 additions and 1 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue