diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-04-16 10:02:05 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-04-16 10:02:05 +0000 |
commit | ab6cadb0c3bb584c5e861ecb16e600ba4e2e154b (patch) | |
tree | a8a24e161b4bada3cadba0027bd7b102be896afb /winsup/cygwin | |
parent | a4ed1daa7fd5e664c3d5293d16c2bed5be767219 (diff) | |
download | cygnal-ab6cadb0c3bb584c5e861ecb16e600ba4e2e154b.tar.gz cygnal-ab6cadb0c3bb584c5e861ecb16e600ba4e2e154b.tar.bz2 cygnal-ab6cadb0c3bb584c5e861ecb16e600ba4e2e154b.zip |
* grp.cc (internal_getgroups): Drop local buf. Allocate groups
directly using alloca.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/grp.cc | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 53c506ef3..93d5eabee 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2008-04-16 Corinna Vinschen <corinna@vinschen.de> + + * grp.cc (internal_getgroups): Drop local buf. Allocate groups + directly using alloca. + 2008-04-14 Corinna Vinschen <corinna@vinschen.de> * postinstall: Fix copy/paste bug. 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; |