mirror of
https://git.sr.ht/~rjarry/aerc
synced 2026-10-23 07:15:14 +02:00
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>