I've debugged into post's copy of m_getfld.
It looks like when it returns from the BODY case, the s->bytes_read is 10
larger than it should be.  There are only 8 nulls added.
It looks like it gets there via the FLD case, via the goto body at line ~620.
(I have debug lines, it's probably a few earlier)

s->bytes_read is 10 at that point.
This seems to be because Getc(s) increments s->bytes_read.

Adding:
+               s->bytes_read = 0;
                goto body;

seems to solve the problem I see, but it feels wrong to me.
I suspect that for some sizes of email that there is still garbage, but it's
not NUL, so it might go less noticed.

The bytes which are processed in that line appear to be the - used in the
divider between headers and body. As far as I can see, this
specific seperator does not get copied into the final body, so it being off
by exactly 10, which is the number of - there does not seem crazy.

--
]               Never tell me the odds!                 | ipv6 mesh networks [
]   Michael Richardson, Sandelman Software Works        | network architect  [
]     [email protected]  http://www.sandelman.ca/        |   ruby on rails    [




Attachment: signature.asc
Description: PGP signature

Reply via email to