From f260596206882a085fd43e5204acaecde72c3bab Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 20 Feb 2012 13:46:29 +1100 Subject: nsstest: Allocate the correct sized buffer for initgroups Found by chance due to a re-order of the tests to start s3member earlier and chasing down a malloc Abort into a valgrind error. Only happens when a user has more than 4 groups. Andrew Bartlett Autobuild-User: Andrew Bartlett Autobuild-Date: Mon Feb 20 05:23:04 CET 2012 on sn-devel-104 --- nsswitch/nsstest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nsswitch/nsstest.c') diff --git a/nsswitch/nsstest.c b/nsswitch/nsstest.c index d84e028513..e2b39bc6be 100644 --- a/nsswitch/nsstest.c +++ b/nsswitch/nsstest.c @@ -370,7 +370,7 @@ static void nss_test_initgroups(char *name, gid_t gid) int i; NSS_STATUS status; - groups = (gid_t *)malloc(size); + groups = (gid_t *)malloc(sizeof(gid_t) * size); groups[0] = gid; status = nss_initgroups(name, gid, &groups, &start, &size); -- cgit