When TIdMessageDecoderMIME.ReadBody() calls TIdMessageDecoder.ReadLn() to read
a binary-encoded line from a non-TCP stream, ReadLn() calls
IdGlobal.ReadLnFromStream(), which does not have an ATerminator parameter. For
binary-encoded data, ReadBody() expects the read to stop on a CRLF terminator
only, and then it writes hard-coded CRLFs into the destination TStream.
However, ReadLnFromStream() stops on a bare CR, a bare LF, or a CRLF, whichever
it encounters first. If a line is terminated by a bare CR or a bare LF, data
corruption occurs. ReadLn() needs to respect its ATerminator parameter
regardless of what type of TStream is being used.
Original issue reported on code.google.com by gambit47 on 16 May 2011 at 4:42
Original issue reported on code.google.com by
gambit47
on 16 May 2011 at 4:42