Fix up an assertion in kern_setgroups, it should compare with ngroups_max + 1

Bug introdued in r273685.

Noted by: Tiwei Bie <btw mail.ustc.edu.cn>
This commit is contained in:
Mateusz Guzik 2014-10-26 14:25:42 +00:00
parent 9d66b6a5a9
commit b90638866e

View File

@ -835,7 +835,7 @@ kern_setgroups(struct thread *td, u_int ngrp, gid_t *groups)
struct ucred *newcred, *oldcred;
int error;
MPASS(ngrp <= ngroups_max);
MPASS(ngrp <= ngroups_max + 1);
AUDIT_ARG_GROUPSET(groups, ngrp);
newcred = crget();
crextend(newcred, ngrp);