Re: NULs in drafts
Michael Richardson <[email protected]> Fri, 07 Nov 2025 14:34:12 -0500
| Newsgroups | gmane.mail.nmh.devel |
|---|---|
| Message-ID | <271279.1762544052@dyas> |
--=-=-= Content-Type: text/plain 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 [ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEERK+9HEcJHTJ9UqTMlUzhVv38QpAFAmkOSbMACgkQlUzhVv38 QpBn2gf/bexg5CaH9o9372YiVZvGDvFPRaewwAskaGNy8wJ9qdSlr1l2EZqyXoV3 /ZskQ2K2tUCdfzCTA8YmLirK9fE9GK6xhNdpjshXHCfq3p7rWvuj7jpYy9B0RyJb l4rlLJp8xHUox/UKonPIAwEVIeWA1pMuDaxl889/0MiXuAelhDPr1g7r2o6tX4TA rAFq4wXrTjh/VhKMe1gy6xTGeixkXTPD0b2AbzS60cujigmY9slTmVdyq2fbasIh DvpBuyyX55ItQeG0nbhkb5T1/WPhoa+B5UO8QjJ9Bcd7dN0PPgBMr0er2QHYZgwK p84aSXYQVHDiTbVdILirRWxFHdYQ7g== =Uvcc -----END PGP SIGNATURE----- --=-=-=--