From a38becce9752e67f71e79e8c230b327869802e70 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 29 Sep 2006 16:52:48 +0000 Subject: * src/shuf.c (read_input): Fix an off-by-one error that would cause an infloop for piped input of 8KB or more. * NEWS: Mention the fix. * tests/misc/shuf: Test for the above fix. --- src/shuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/shuf.c') diff --git a/src/shuf.c b/src/shuf.c index 39cfdfffb..68003c259 100644 --- a/src/shuf.c +++ b/src/shuf.c @@ -178,7 +178,7 @@ read_input (FILE *in, char eolbyte, char ***pline) do { - if (alloc == used) + if (alloc <= used + 1) { if (alloc == SIZE_MAX) xalloc_die (); -- cgit v1.2.3-54-g00ecf