mirror of
https://github.com/opnsense/src.git
synced 2026-06-11 09:41:03 -04:00
Since all other comparisons involving ngroups_max use
"ngroups_max + 1", use ">= ngroups_max+1" instead of the equivalent "> ngroups_max" to reduce confusion.
This commit is contained in:
parent
bc1b4f78f9
commit
3ef5ae2dde
2 changed files with 2 additions and 2 deletions
|
|
@ -1138,7 +1138,7 @@ linux_setgroups(struct thread *td, struct linux_setgroups_args *args)
|
|||
struct proc *p;
|
||||
|
||||
ngrp = args->gidsetsize;
|
||||
if (ngrp < 0 || ngrp > ngroups_max)
|
||||
if (ngrp < 0 || ngrp >= ngroups_max + 1)
|
||||
return (EINVAL);
|
||||
linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK);
|
||||
error = copyin(args->grouplist, linux_gidset, ngrp * sizeof(l_gid_t));
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ linux_setgroups16(struct thread *td, struct linux_setgroups16_args *args)
|
|||
#endif
|
||||
|
||||
ngrp = args->gidsetsize;
|
||||
if (ngrp < 0 || ngrp > ngroups_max)
|
||||
if (ngrp < 0 || ngrp >= ngroups_max + 1)
|
||||
return (EINVAL);
|
||||
linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK);
|
||||
error = copyin(args->gidset, linux_gidset, ngrp * sizeof(l_gid16_t));
|
||||
|
|
|
|||
Loading…
Reference in a new issue