summaryrefslogtreecommitdiff
path: root/debug
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-10-31 21:34:01 +0000
committerJakub Jelinek <jakub@redhat.com>2008-10-31 21:34:01 +0000
commitc02fa54041a68c12107ec577770ff81329af3bef (patch)
treeac6d3ee86cd046eca0c09c2de43695b5f3116d69 /debug
parent242bfefc41f4cc06dcff88c5bd143cc43719a73a (diff)
Updated to fedora-glibc-20081031T2102cvs/fedora-glibc-2_8_90-16
Diffstat (limited to 'debug')
-rw-r--r--debug/getgroups_chk.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/debug/getgroups_chk.c b/debug/getgroups_chk.c
index c877ddb9ca..8c3d99da7e 100644
--- a/debug/getgroups_chk.c
+++ b/debug/getgroups_chk.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 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
@@ -23,6 +23,12 @@
int
__getgroups_chk (int size, __gid_t list[], size_t listlen)
{
+ if (__builtin_expect (size < 0, 0))
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
if (__builtin_expect (size * sizeof (__gid_t) > listlen, 0))
__chk_fail ();