From 31f7410f5c413605f039e898151f01231f11efa5 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 8 Jun 1998 13:37:25 +0000 Subject: Update. 1998-06-08 13:34 Ulrich Drepper * elf/sprof.c: Implement call graph profiling. * sysdeps/generic/getenv.c: Optimize to use strncmp less often. 1998-06-07 Andreas Jaeger * 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 . 1998-06-07 Andreas Schwab * libio/genops.c (__underflow): Read character from read pointer as unsigned. (__uflow): Likewise. --- pwd/fgetpwent_r.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pwd') diff --git a/pwd/fgetpwent_r.c b/pwd/fgetpwent_r.c index 534afd58f5..87ea1dedda 100644 --- a/pwd/fgetpwent_r.c +++ b/pwd/fgetpwent_r.c @@ -74,14 +74,14 @@ __fgetpwent_r (FILE *stream, struct passwd *resbuf, char *buffer, 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; -- cgit 1.4.1