about summary refs log tree commit diff
path: root/shadow/fgetspent_r.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-06-08 13:37:25 +0000
committerUlrich Drepper <drepper@redhat.com>1998-06-08 13:37:25 +0000
commit31f7410f5c413605f039e898151f01231f11efa5 (patch)
tree3c920d642b67b6d739877f2f22faf2d8b9ee6e84 /shadow/fgetspent_r.c
parentc0fb8a563c1c49e5fbec9bc22deac618910a3ff4 (diff)
downloadglibc-31f7410f5c413605f039e898151f01231f11efa5.tar.gz
glibc-31f7410f5c413605f039e898151f01231f11efa5.tar.xz
glibc-31f7410f5c413605f039e898151f01231f11efa5.zip
Update.
1998-06-08 13:34  Ulrich Drepper  <drepper@cygnus.com>

	* elf/sprof.c: Implement call graph profiling.

	* sysdeps/generic/getenv.c: Optimize to use strncmp less often.

1998-06-07  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* pwd/fgetpwent_r.c (__fgetpwent_r): Correct buffer overflow fix.
	* grp/fgetgrent_r.c (__fgetgrent_r): Likewise.
	* shadow/fgetspent_r.c (__fgetspent_r): Likewise.
	Noticed by Jake Garver <garver@valkyrie.net>.

1998-06-07  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* libio/genops.c (__underflow): Read character from read pointer
	as unsigned.
	(__uflow): Likewise.
Diffstat (limited to 'shadow/fgetspent_r.c')
-rw-r--r--shadow/fgetspent_r.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/shadow/fgetspent_r.c b/shadow/fgetspent_r.c
index cb14a23037..bf4a3f8c08 100644
--- a/shadow/fgetspent_r.c
+++ b/shadow/fgetspent_r.c
@@ -41,14 +41,14 @@ __fgetspent_r (FILE *stream, struct spwd *resbuf, char *buffer, size_t buflen,
 
   do
     {
-      buffer[buflen] = '\xff';
+      buffer[buflen - 1] = '\xff';
       p = fgets (buffer, buflen, stream);
       if (p == NULL && feof (stream))
 	{
 	  *result = NULL;
 	  return errno;
 	}
-      if (p == NULL || buffer[buflen] != '\xff')
+      if (p == NULL || buffer[buflen - 1] != '\xff')
 	{
 	  *result = NULL;
 	  return errno = ERANGE;