From 285b446d1777b9515bb83df7b18d17359f49f921 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Sat, 23 Sep 2000 19:56:46 +0000 Subject: Fix potential memory overrun... --- utility.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utility.c b/utility.c index 719cd98ce..2ec44d901 100644 --- a/utility.c +++ b/utility.c @@ -1606,7 +1606,7 @@ extern char *get_line_from_file(FILE *file) if (ch == EOF) break; /* grow the line buffer as necessary */ - if (idx > linebufsz-2) + while (idx > linebufsz-2) linebuf = xrealloc(linebuf, linebufsz += GROWBY); linebuf[idx++] = (char)ch; if ((char)ch == '\n') -- cgit v1.2.3