This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.11-183-gcaa6e77


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  caa6e77293d85e31dfde371b78862e9330a1478e (commit)
      from  1a36db1c125785826afbf169d26a9afd98577d65 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=caa6e77293d85e31dfde371b78862e9330a1478e

commit caa6e77293d85e31dfde371b78862e9330a1478e
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Wed Feb 3 06:23:31 2010 -0800

    Fix endless loop with invalid /etc/shells file.

diff --git a/ChangeLog b/ChangeLog
index e8aad25..f895a8c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-03  Ulrich Drepper  <drepper@redhat.com>
+
+	[BZ #11242]
+	* misc/getusershell.c (initshells): Allocate one more byte in input
+	buffer so that fgets doesn't loop undefinitely.
+
 2010-02-02  Ulrich Drepper  <drepper@redhat.com>
 
 	* stdlib/setenv.c (__add_to_environ): Don't use alloca if
diff --git a/misc/getusershell.c b/misc/getusershell.c
index 636da32..0e4f796 100644
--- a/misc/getusershell.c
+++ b/misc/getusershell.c
@@ -116,7 +116,8 @@ initshells()
 	}
 	if (statb.st_size > ~(size_t)0 / sizeof (char *) * 3)
 		goto init_okshells;
-	if ((strings = malloc(statb.st_size + 2)) == NULL)
+	flen = statb.st_size + 3;
+	if ((strings = malloc(flen)) == NULL)
 		goto init_okshells;
 	shells = malloc(statb.st_size / 3 * sizeof (char *));
 	if (shells == NULL) {
@@ -126,7 +127,6 @@ initshells()
 	}
 	sp = shells;
 	cp = strings;
-	flen = statb.st_size + 2;
 	while (fgets_unlocked(cp, flen - (cp - strings), fp) != NULL) {
 		while (*cp != '#' && *cp != '/' && *cp != '\0')
 			cp++;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |    6 ++++++
 misc/getusershell.c |    4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]