* grp.cc (internal_getgroups): Drop local buf. Allocate groups

directly using alloca.
This commit is contained in:
Corinna Vinschen 2008-04-16 10:02:05 +00:00
parent a4ed1daa7f
commit ab6cadb0c3
2 changed files with 7 additions and 3 deletions

View File

@ -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.

View File

@ -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;