From: Ken Hornstein Date: Tue, 31 Jan 2012 18:20:40 +0000 (-0500) Subject: Whoops, I need to make sure the buffer I pass to putcomp() is NULL-terminated. X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=aaf31d46368bcf63f7ae4b0019ef09d098f98491;p=mmh Whoops, I need to make sure the buffer I pass to putcomp() is NULL-terminated. --- diff --git a/uip/mhlsbr.c b/uip/mhlsbr.c index 1446c2a..a44413c 100644 --- a/uip/mhlsbr.c +++ b/uip/mhlsbr.c @@ -1949,7 +1949,8 @@ filterbody (struct mcomp *c1, char *buf, int bufsz, int state, FILE *fp) holder.c_text = buf; - while ((cc = read(fdoutput[0], buf, bufsz)) > 0) { + while ((cc = read(fdoutput[0], buf, bufsz - 1)) > 0) { + buf[cc] = '\0'; putcomp(c1, &holder, BODYCOMP); }