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
c5fa288ed5
commit
f354ae0814
@ -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 New Issue
Block a user