linux: setgroups16(): Pre-extend the groups array

For the size we know we will need in the end.

No functional change (intended).

MFC after:      5 days
Sponsored by:   The FreeBSD Foundation
Differential Revision:  https://reviews.freebsd.org/D52279
This commit is contained in:
Olivier Certner
2025-08-28 18:27:30 +02:00
parent b7a87d7c0d
commit b1326edddb
+1
View File
@@ -102,6 +102,7 @@ linux_setgroups16(struct thread *td, struct linux_setgroups16_args *args)
}
newcred = crget();
crextend(newcred, ngrp);
p = td->td_proc;
PROC_LOCK(p);
oldcred = crcopysafe(p, newcred);