Fix potential memory overrun...

This commit is contained in:
Eric Andersen 2000-09-23 19:56:46 +00:00
parent 32e95f988d
commit 285b446d17

View File

@ -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')