From 83a4b574315c2d19232df868db974b530679c86f Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 8 Jun 1998 09:55:48 +0000 Subject: [PATCH] (__fgetspent_r): Correct buffer overflow fix. --- shadow/fgetspent_r.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shadow/fgetspent_r.c b/shadow/fgetspent_r.c index fc9dedea24f..3c624448074 100644 --- a/shadow/fgetspent_r.c +++ b/shadow/fgetspent_r.c @@ -47,7 +47,7 @@ __fgetspent_r (FILE *stream, struct spwd *resbuf, char *buffer, size_t buflen, *result = NULL; return errno; } - if (p == NULL || buffer[buflen] != '\xff') + if (p == NULL || buffer[buflen - 1] != '\xff') { *result = NULL; return errno = ERANGE; -- 2.47.2