From d6b2613a6ea39d97599b714eb6722745c71ab957 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 16 Apr 2009 17:03:38 -0500 Subject: [PATCH] Fix bug spotted by Jean-Christphe Dubois: reserve space for null terminator. --- lib/lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lib.c b/lib/lib.c index ecef64d..e4b9d8e 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; -- 2.7.4