Project

General

Profile

Feature #4568 ยป 0001-file.c-rb_group_member-kill-256K-of-stack-usage.patch

normalperson (Eric Wong), 04/11/2011 04:01 PM

View differences:

file.c
static int
rb_group_member(GETGROUPS_T gid)
{
int rv = FALSE;
#ifndef _WIN32
if (getgid() == gid || getegid() == gid)
return TRUE;
......
# endif
# endif
{
GETGROUPS_T gary[NGROUPS];
GETGROUPS_T *gary;
int anum;
gary = xmalloc(NGROUPS * sizeof(GETGROUPS_T));
anum = getgroups(NGROUPS, gary);
while (--anum >= 0)
if (gary[anum] == gid)
return TRUE;
while (--anum >= 0) {
if (gary[anum] == gid) {
rv = TRUE;
break;
}
}
xfree(gary);
}
# endif
#endif
return FALSE;
return rv;
}
#ifndef S_IXUGO
    (1-1/1)