From: Timo Sirainen Date: Tue, 14 Sep 2010 14:22:37 +0000 (+0100) Subject: istream-crlf: Fixed assert-crash. X-Git-Tag: 2.0.3~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4fe93a9c242d745e0cf2e6cc58d5caf265de2a0;p=thirdparty%2Fdovecot%2Fcore.git istream-crlf: Fixed assert-crash. --- diff --git a/src/lib/istream-crlf.c b/src/lib/istream-crlf.c index 9d97472ede..4e52914877 100644 --- a/src/lib/istream-crlf.c +++ b/src/lib/istream-crlf.c @@ -93,11 +93,11 @@ static ssize_t i_stream_crlf_read_crlf(struct istream_private *stream) if (src[-1] != '\r') *dest++ = '\r'; - if (dest < dest_end) { - *dest++ = '\n'; - src++; - } + if (dest == dest_end) + break; + *dest++ = '\n'; + src++; i_assert(src == ptr + 1); }