diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -3653,8 +3653,6 @@ ngroups = NGROUPS_MAX + 1; } - if (ngroups > NGROUPS_MAX) - ngroups = NGROUPS_MAX; if (ngroups > SMALLNGROUPS) cr->cr_groups = malloc(ngroups * sizeof(gid_t)); cr->cr_ngroups = ngroups; @@ -3688,7 +3686,7 @@ } else { group = name_ul; } - if (cr->cr_ngroups == NGROUPS_MAX) { + if (cr->cr_ngroups == NGROUPS_MAX + 1) { syslog(LOG_ERR, "too many groups"); break; }