svn commit: r202341 - head/sys/compat/linux

Brooks Davis brooks at FreeBSD.org
Fri Jan 15 07:05:00 UTC 2010


Author: brooks
Date: Fri Jan 15 07:05:00 2010
New Revision: 202341
URL: http://svn.freebsd.org/changeset/base/202341

Log:
  Since all other comparisons involving ngroups_max use
  "ngroups_max + 1", use ">= ngroups_max+1" instead of the equivalent
  "> ngroups_max" to reduce confusion.

Modified:
  head/sys/compat/linux/linux_misc.c
  head/sys/compat/linux/linux_uid16.c

Modified: head/sys/compat/linux/linux_misc.c
==============================================================================
--- head/sys/compat/linux/linux_misc.c	Fri Jan 15 04:09:22 2010	(r202340)
+++ head/sys/compat/linux/linux_misc.c	Fri Jan 15 07:05:00 2010	(r202341)
@@ -1138,7 +1138,7 @@ linux_setgroups(struct thread *td, struc
 	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));

Modified: head/sys/compat/linux/linux_uid16.c
==============================================================================
--- head/sys/compat/linux/linux_uid16.c	Fri Jan 15 04:09:22 2010	(r202340)
+++ head/sys/compat/linux/linux_uid16.c	Fri Jan 15 07:05:00 2010	(r202341)
@@ -109,7 +109,7 @@ linux_setgroups16(struct thread *td, str
 #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));


More information about the svn-src-head mailing list