dovecot-2.0: imap-parser: Don't return early if line ends with C...

dovecot at dovecot.org dovecot at dovecot.org
Tue May 26 04:23:01 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/704917a65a16
changeset: 9367:704917a65a16
user:      Timo Sirainen <tss at iki.fi>
date:      Mon May 25 21:22:55 2009 -0400
description:
imap-parser: Don't return early if line ends with CR but there's no LF.

diffstat:

1 file changed, 9 insertions(+)
src/lib-imap/imap-parser.c |    9 +++++++++

diffs (19 lines):

diff -r 9297ae2ee45f -r 704917a65a16 src/lib-imap/imap-parser.c
--- a/src/lib-imap/imap-parser.c	Mon May 25 21:22:47 2009 -0400
+++ b/src/lib-imap/imap-parser.c	Mon May 25 21:22:55 2009 -0400
@@ -453,6 +453,15 @@ static int imap_parser_read_arg(struct i
 
 		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;


More information about the dovecot-cvs mailing list