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:
brooks 2010-01-15 07:05:00 +00:00
parent c5fa288ed5
commit f354ae0814
2 changed files with 2 additions and 2 deletions

View File

@ -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));

View File

@ -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));