about summary refs log tree commit diff
path: root/src/linux/initgroups.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-04-20 19:15:27 -0400
committerRich Felker <dalias@aerifal.cx>2011-04-20 19:15:27 -0400
commit29a15ad077bd7af683d3c838d21be1c216f22f8f (patch)
tree2c73074e6279383df5c2d571ecd4e0cfa9152c6c /src/linux/initgroups.c
parent18bca575107d80ca81241d1429ded62918c5bd2e (diff)
downloadmusl-29a15ad077bd7af683d3c838d21be1c216f22f8f.tar.gz
musl-29a15ad077bd7af683d3c838d21be1c216f22f8f.tar.xz
musl-29a15ad077bd7af683d3c838d21be1c216f22f8f.zip
fix initgroups (uninitialized count passed to getgrouplist)
Diffstat (limited to 'src/linux/initgroups.c')
-rw-r--r--src/linux/initgroups.c2
1 files changed, 1 insertions, 1 deletions
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);
 }