From ab6cadb0c3bb584c5e861ecb16e600ba4e2e154b Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 16 Apr 2008 10:02:05 +0000 Subject: * grp.cc (internal_getgroups): Drop local buf. Allocate groups directly using alloca. --- winsup/cygwin/grp.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'winsup/cygwin/grp.cc') diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc index 5c35be590..e9e657d88 100644 --- a/winsup/cygwin/grp.cc +++ b/winsup/cygwin/grp.cc @@ -365,10 +365,9 @@ internal_getgroups (int gidsetsize, __gid32_t *grouplist, cygpsid * srchsid) if (GetTokenInformation (hToken, TokenGroups, NULL, 0, &size) || GetLastError () == ERROR_INSUFFICIENT_BUFFER) { - char buf[size]; - TOKEN_GROUPS *groups = (TOKEN_GROUPS *) buf; + PTOKEN_GROUPS groups = (PTOKEN_GROUPS) alloca (size); - if (GetTokenInformation (hToken, TokenGroups, buf, size, &size)) + if (GetTokenInformation (hToken, TokenGroups, groups, size, &size)) { cygsid sid; -- cgit v1.2.3