summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2010-01-15 07:05:00 +0000
committerbrooks <brooks@FreeBSD.org>2010-01-15 07:05:00 +0000
commitf354ae0814810e4c8aeeea7b9765ba2b6b7d51b2 (patch)
treeba9d01e7a7e11ab0dfaa41cee7b6f6159c0e92b7 /sys/compat
parentc5fa288ed5a9c86497430e9ccb67115b5066e6a8 (diff)
downloadFreeBSD-src-f354ae0814810e4c8aeeea7b9765ba2b6b7d51b2.zip
FreeBSD-src-f354ae0814810e4c8aeeea7b9765ba2b6b7d51b2.tar.gz
Since all other comparisons involving ngroups_max use
"ngroups_max + 1", use ">= ngroups_max+1" instead of the equivalent "> ngroups_max" to reduce confusion.
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_misc.c2
-rw-r--r--sys/compat/linux/linux_uid16.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index 7ea1243..d2cf6b6 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -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));
diff --git a/sys/compat/linux/linux_uid16.c b/sys/compat/linux/linux_uid16.c
index 7bbfc8d..6ad674b 100644
--- a/sys/compat/linux/linux_uid16.c
+++ b/sys/compat/linux/linux_uid16.c
@@ -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));
OpenPOWER on IntegriCloud