aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-10-31 14:27:36 +0000
committerUlrich Drepper <drepper@redhat.com>2008-10-31 14:27:36 +0000
commit4bed549a2277f911397ca59189ae71f79750f400 (patch)
tree0aac6faff2726fd62a37eb9c1844b930cc1c43b7 /posix/bits
parent[BZ #6995] (diff)
downloadglibc-4bed549a2277f911397ca59189ae71f79750f400.tar.gz
glibc-4bed549a2277f911397ca59189ae71f79750f400.tar.bz2
glibc-4bed549a2277f911397ca59189ae71f79750f400.zip
[BZ #6980]
* debug/getgroups_chk.c (__getgroups_chk): Return EINVAL error for negative sizees. * posix/bits/unistd.h (getgroups): Call __getgroups_chk for negative __size.
Diffstat (limited to 'posix/bits')
-rw-r--r--posix/bits/unistd.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/posix/bits/unistd.h b/posix/bits/unistd.h
index efd7f75a50..e29b4cca46 100644
--- a/posix/bits/unistd.h
+++ b/posix/bits/unistd.h
@@ -1,5 +1,5 @@
/* Checking macros for unistd functions.
- Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -267,7 +267,7 @@ __NTH (getgroups (int __size, __gid_t __list[]))
{
if (__bos (__list) != (size_t) -1)
{
- if (!__builtin_constant_p (__size))
+ if (!__builtin_constant_p (__size) || __size < 0)
return __getgroups_chk (__size, __list, __bos (__list));
if (__size * sizeof (__gid_t) > __bos (__list))