diff options
author | Eric Blake <ebb9@byu.net> | 2009-11-13 12:53:17 -0700 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-11-13 12:53:17 -0700 |
commit | 1e642be936b3a09f6200d753f035ce045d9c5dac (patch) | |
tree | 84ba50304c612d75a74420415e5cefd74586062a /tests | |
parent | f3a2c4aaa9ad3ed11c1437cdce8ae172fd273a1f (diff) | |
download | gnulib-1e642be936b3a09f6200d753f035ce045d9c5dac.tar.gz |
getgroups: work around FreeBSD bug
FreeBSD 7.2 mistakenly succeeds on getgroups(-1,ptr) (POSIX
requires EINVAL failure since -1 is less than the proper result).
* lib/getgroups.c (rpl_getgroups): Work around the bug.
* m4/getgroups.m4 (gl_FUNC_GETGROUPS): Detect the bug.
* doc/posix-functions/getgroups.texi (getgroups): Document it.
* tests/test-getgroups.c (main): Fix buffer overrun.
Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-getgroups.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test-getgroups.c b/tests/test-getgroups.c index b2e65a02fd..aed80f1813 100644 --- a/tests/test-getgroups.c +++ b/tests/test-getgroups.c @@ -52,7 +52,7 @@ main (int argc, char **argv _UNUSED_PARAMETER_) } ASSERT (0 <= result); ASSERT (result + 1 < SIZE_MAX / sizeof *groups); - groups = malloc (result + 1 * sizeof *groups); + groups = malloc ((result + 1) * sizeof *groups); ASSERT (groups); groups[result] = -1; /* Check for EINVAL handling. Not all processes have supplemental |