From: Rich Felker Date: Wed, 20 Apr 2011 23:15:27 +0000 (-0400) Subject: fix initgroups (uninitialized count passed to getgrouplist) X-Git-Tag: v0.7.9~13 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=29a15ad077bd7af683d3c838d21be1c216f22f8f;p=oweals%2Fmusl.git fix initgroups (uninitialized count passed to getgrouplist) --- 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); }