Mercurial > dovecot > original-hg > dovecot-1.2
changeset 9081:09f78cad5d58 HEAD
imap-parser: Don't return early if line ends with CR but there's no LF.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 25 May 2009 21:23:21 -0400 |
parents | f1b0ef72cea7 |
children | 478ad35af83a |
files | src/lib-imap/imap-parser.c |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-imap/imap-parser.c Mon May 25 20:41:08 2009 -0400 +++ b/src/lib-imap/imap-parser.c Mon May 25 21:23:21 2009 -0400 @@ -453,6 +453,15 @@ 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;