--- camel/camel-mime-filter-crlf.c 2005-08-31 06:21:56.000000000 +0200 +++ camel/camel-mime-filter-crlf.c.new 2006-11-06 07:40:33.000000000 +0100 @@ -97,7 +97,11 @@ filter (CamelMimeFilter *f, char *in, si *outptr++ = *inptr++; } } else { - camel_mime_filter_set_size (f, len, FALSE); + /* Output can "grow" by one byte if crlf->saw_cr was set as + * a carry-over from the previous invocation. This will happen + * in practice, as the input is processed in arbitrarily-sized + * blocks. */ + camel_mime_filter_set_size (f, len+1, FALSE); outptr = f->outbuf; while (inptr < inend) {