From: Timo Sirainen Date: Tue, 26 May 2009 01:22:55 +0000 (-0400) Subject: imap-parser: Don't return early if line ends with CR but there's no LF. X-Git-Tag: 2.0.alpha1~685 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e971e4968926ae21f49e6cc58d138608520ab03;p=thirdparty%2Fdovecot%2Fcore.git imap-parser: Don't return early if line ends with CR but there's no LF. --HG-- branch : HEAD --- diff --git a/src/lib-imap/imap-parser.c b/src/lib-imap/imap-parser.c index 2d6bb85d1b..8c5fed7060 100644 --- a/src/lib-imap/imap-parser.c +++ b/src/lib-imap/imap-parser.c @@ -453,6 +453,15 @@ static int imap_parser_read_arg(struct imap_parser *parser) switch (data[0]) { case '\r': + if (data_size == 1) { + /* wait for LF */ + return FALSE; + } + if (data[1] != '\n') { + parser->error = "CR sent without LF"; + return FALSE; + } + /* fall through */ case '\n': /* unexpected end of line */ parser->eol = TRUE;