diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-04-16 14:02:05 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-04-16 14:02:05 +0400 |
commit | ab6cadb0c3bb584c5e861ecb16e600ba4e2e154b (patch) | |
tree | a8a24e161b4bada3cadba0027bd7b102be896afb /winsup/cygwin/grp.cc | |
parent | a4ed1daa7fd5e664c3d5293d16c2bed5be767219 (diff) |
* grp.cc (internal_getgroups): Drop local buf. Allocate groups
directly using alloca.
Diffstat (limited to 'winsup/cygwin/grp.cc')
-rw-r--r-- | winsup/cygwin/grp.cc | 5 |
1 files changed, 2 insertions, 3 deletions
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; |