summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-07-29 15:48:47 +0000
committerUlrich Drepper <drepper@redhat.com>1999-07-29 15:48:47 +0000
commitea3e6a3a65a176a77f829e82939a13d15a1264dc (patch)
tree05adff49fe1c52865f5f5143b24a19a177f5dde6
parent6b7986213d4e31397be7e728df929f780ee77871 (diff)
downloadglibc-ea3e6a3a65a176a77f829e82939a13d15a1264dc.tar.gz
glibc-ea3e6a3a65a176a77f829e82939a13d15a1264dc.tar.xz
glibc-ea3e6a3a65a176a77f829e82939a13d15a1264dc.zip
Update.
1999-07-29  Ulrich Drepper  <drepper@cygnus.com>

	* nis/nss_nis/nis-initgroups.c (_nss_nis_initgroups): Correct size
	argument in realloc call.
	* nis/nss_compat/compat-initgroups.c (_nss_compat_initgroups):
	Likewise.
	Reported by Danny Braniss <danny@cs.huji.ac.il>.
-rw-r--r--ChangeLog8
-rw-r--r--nis/nss_compat/compat-initgroups.c4
-rw-r--r--nis/nss_nis/nis-initgroups.c4
3 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index a087ab7639..b11b07dc56 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+1999-07-29  Ulrich Drepper  <drepper@cygnus.com>
+
+	* nis/nss_nis/nis-initgroups.c (_nss_nis_initgroups): Correct size
+	argument in realloc call.
+	* nis/nss_compat/compat-initgroups.c (_nss_compat_initgroups):
+	Likewise.
+	Reported by Danny Braniss <danny@cs.huji.ac.il>.
+
 1999-07-28  Ulrich Drepper  <drepper@cygnus.com>
 
 	* misc/efgcvt.c: Use IEEE 854 formula to compute the number of digits
diff --git a/nis/nss_compat/compat-initgroups.c b/nis/nss_compat/compat-initgroups.c
index a0c3455eb6..47b395ede6 100644
--- a/nis/nss_compat/compat-initgroups.c
+++ b/nis/nss_compat/compat-initgroups.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1998.
 
@@ -620,7 +620,7 @@ _nss_compat_initgroups (const char *user, gid_t group, long int *start,
                 if (*start == *size && limit <= 0)
                   {
                     /* Need a bigger buffer.  */
-                    groups = realloc (groups, *size * sizeof (*groups));
+                    groups = realloc (groups, 2 * *size * sizeof (*groups));
                     if (groups == NULL)
                       goto done;
                     *size *= 2;
diff --git a/nis/nss_nis/nis-initgroups.c b/nis/nss_nis/nis-initgroups.c
index b69fea4e85..c5577c9ced 100644
--- a/nis/nss_nis/nis-initgroups.c
+++ b/nis/nss_nis/nis-initgroups.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1998.
 
@@ -174,7 +174,7 @@ _nss_nis_initgroups (const char *user, gid_t group, long int *start,
                 if (*start == *size && limit <= 0)
                   {
                     /* Need a bigger buffer.  */
-		    groups = realloc (groups, *size * sizeof (*groups));
+		    groups = realloc (groups, 2 * *size * sizeof (*groups));
 		    if (groups == NULL)
 		      goto done;
                     *size *= 2;