Date: Fri, 15 Jan 2010 07:05:00 +0000 (UTC) From: Brooks Davis <brooks@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r202341 - head/sys/compat/linux Message-ID: <201001150705.o0F750Oh080811@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001150705.o0F750Oh080811>