From 29a15ad077bd7af683d3c838d21be1c216f22f8f Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 20 Apr 2011 19:15:27 -0400 Subject: [PATCH] fix initgroups (uninitialized count passed to getgrouplist) --- src/linux/initgroups.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linux/initgroups.c b/src/linux/initgroups.c index ef9bc10a..545d1859 100644 --- a/src/linux/initgroups.c +++ b/src/linux/initgroups.c @@ -9,7 +9,7 @@ int setgroups(size_t, const gid_t *); int initgroups(const char *user, gid_t gid) { gid_t groups[NGROUPS_MAX]; - int count; + int count = NGROUPS_MAX; if (getgrouplist(user, gid, groups, &count) < 0) return -1; return setgroups(count, groups); } -- 2.25.1