Files
Robin Jarryandjp39 9038a295f6 send: avoid writing corrupted messages to smtp
Appending CRLF bufio.Scanner.Bytes() is not reliable at all. This
function returns a slice to an internal buffer that may contain the rest
of the message (following lines). Appending things to it may modify the
internal buffer, corrupting the rest of it.

Write scan.Bytes() directly without any modification and append the CRLF
line ending in a separate Write call.

Fixes: cb1c4c9c62 ("send: ensure crlf line endings")
Co-authored-by: jp39 <jp39@gmx.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Tristan Partin <tristan@partin.io>
2026-07-26 14:29:00 +02:00
..
2026-03-27 09:07:01 +01:00