]> git.marmaro.de Git - mmh/commitdiff
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 1446c2a78d721f2629de65ad94f4b4fbb9658690..a44413cd1b4496b3d71b9c92f551467d746c52d1 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);
     }