summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-02-20 13:46:29 +1100
committerAndrew Bartlett <abartlet@samba.org>2012-02-20 05:23:04 +0100
commitf260596206882a085fd43e5204acaecde72c3bab (patch)
tree49e56e93e4cfb9437cbe97b2dac70fe01497e6ab /nsswitch
parent8c3bbc09795937f359cbfee027821a4648b7d941 (diff)
downloadsamba-f260596206882a085fd43e5204acaecde72c3bab.tar.gz
samba-f260596206882a085fd43e5204acaecde72c3bab.tar.bz2
samba-f260596206882a085fd43e5204acaecde72c3bab.zip
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 <abartlet@samba.org> Autobuild-Date: Mon Feb 20 05:23:04 CET 2012 on sn-devel-104
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/nsstest.c2
1 files changed, 1 insertions, 1 deletions
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);