Whoops, I need to make sure the buffer I pass to putcomp() is NULL-terminated.
authorKen Hornstein <kenh@pobox.com>
Tue, 31 Jan 2012 18:20:40 +0000 (13:20 -0500)
committerKen Hornstein <kenh@pobox.com>
Tue, 31 Jan 2012 18:20:40 +0000 (13:20 -0500)
uip/mhlsbr.c

index 1446c2a..a44413c 100644 (file)
@@ -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);
     }