diff options
Diffstat (limited to '')
-rw-r--r-- | src/bltin/test.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bltin/test.c b/src/bltin/test.c index 9b09094..f16c819 100644 --- a/src/bltin/test.c +++ b/src/bltin/test.c @@ -489,7 +489,8 @@ bash_group_member(gid_t gid) ngroups = getgroups(0, NULL); group_array = stalloc(ngroups * sizeof(gid_t)); - getgroups(ngroups, group_array); + if ((getgroups(ngroups, group_array)) != ngroups) + return (0); /* Search through the list looking for GID. */ for (i = 0; i < ngroups; i++) |