jumaris / indyproject

Automatically exported from code.google.com/p/indyproject
0 stars 0 forks source link

IdMessageDecoder.ReadLn() corrupts binary data #192

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago

Original comment by gambit47 on 16 May 2011 at 4:42

GoogleCodeExporter commented 9 years ago
Fixed in rev 4636.

Original comment by gambit47 on 12 Dec 2012 at 10:25