aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2009-04-16 17:03:38 -0500
committerRob Landley <rob@landley.net>2009-04-16 17:03:38 -0500
commitd6b2613a6ea39d97599b714eb6722745c71ab957 (patch)
tree69b078a148c5d75b8d510b1fb28c78f8a908f3de
parent25afd6548d9cd0ed3c9a3865c6ff73dbfd65f97d (diff)
downloadtoybox-d6b2613a6ea39d97599b714eb6722745c71ab957.tar.gz
Fix bug spotted by Jean-Christphe Dubois: reserve space for null terminator.
-rw-r--r--lib/lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/lib.c b/lib/lib.c
index ecef64dc..e4b9d8eb 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -650,7 +650,7 @@ char *get_rawline(int fd, long *plen, char end)
for (;;) {
if (1>read(fd, &c, 1)) break;
- if (!(len & 63)) buf=xrealloc(buf, len+64);
+ if (!(len & 63)) buf=xrealloc(buf, len+65);
if ((buf[len++]=c) == end) break;
}
if (buf) buf[len]=0;