aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-09-23 19:56:46 +0000
committerEric Andersen <andersen@codepoet.org>2000-09-23 19:56:46 +0000
commit285b446d1777b9515bb83df7b18d17359f49f921 (patch)
treea770146edff347eb415d04ab63c5c8d4a2e28de0
parent32e95f988d3a395de375296ac4f955cc330d39bf (diff)
downloadbusybox-w32-285b446d1777b9515bb83df7b18d17359f49f921.tar.gz
busybox-w32-285b446d1777b9515bb83df7b18d17359f49f921.tar.bz2
busybox-w32-285b446d1777b9515bb83df7b18d17359f49f921.zip
Fix potential memory overrun...
-rw-r--r--utility.c2
1 files changed, 1 insertions, 1 deletions
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)
1606 if (ch == EOF) 1606 if (ch == EOF)
1607 break; 1607 break;
1608 /* grow the line buffer as necessary */ 1608 /* grow the line buffer as necessary */
1609 if (idx > linebufsz-2) 1609 while (idx > linebufsz-2)
1610 linebuf = xrealloc(linebuf, linebufsz += GROWBY); 1610 linebuf = xrealloc(linebuf, linebufsz += GROWBY);
1611 linebuf[idx++] = (char)ch; 1611 linebuf[idx++] = (char)ch;
1612 if ((char)ch == '\n') 1612 if ((char)ch == '\n')