about summary refs log tree commit diff
path: root/grp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-04-01 15:13:31 +0000
committerJakub Jelinek <jakub@redhat.com>2005-04-01 15:13:31 +0000
commite8eaba2b25948c0e60f70c33c5c52aad70bbf5fc (patch)
tree020566c0ffd2d27131ee7bac45eea5560a4732bd /grp
parente3166b6660ce5f0640242a4806a380bb651a2291 (diff)
downloadglibc-e8eaba2b25948c0e60f70c33c5c52aad70bbf5fc.tar.gz
glibc-e8eaba2b25948c0e60f70c33c5c52aad70bbf5fc.tar.xz
glibc-e8eaba2b25948c0e60f70c33c5c52aad70bbf5fc.zip
Updated to fedora-glibc-20050401T1444
Diffstat (limited to 'grp')
-rw-r--r--grp/initgroups.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/grp/initgroups.c b/grp/initgroups.c
index d052cf48f7..b887a973ff 100644
--- a/grp/initgroups.c
+++ b/grp/initgroups.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1989,91,93,1996-2003, 2004  Free Software Foundation, Inc.
+/* Copyright (C) 1989,91,93,1996-2003, 2004, 2005  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
@@ -73,7 +73,9 @@ internal_getgrouplist (const char *user, gid_t group, long int *size,
   /* Start is one, because we have the first group as parameter.  */
   long int start = 1;
 
-  (*groupsp)[0] = group;
+  /* Never store more than the starting *SIZE number of elements.  */
+  if (*size > 0)
+    (*groupsp)[0] = group;
 
   if (__nss_group_database != NULL)
     {