[dovecot-cvs] dovecot/src/lib-imap imap-parser.c,1.42,1.43

cras at procontrol.fi cras at procontrol.fi
Sun Mar 9 02:35:22 EET 2003


Update of /home/cvs/dovecot/src/lib-imap
In directory danu:/tmp/cvs-serv13671/lib-imap

Modified Files:
	imap-parser.c 
Log Message:
Literal parser broke if \r\n wasn't in buffer at the time '}' was parsed.



Index: imap-parser.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-imap/imap-parser.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- imap-parser.c	14 Feb 2003 10:58:50 -0000	1.42
+++ imap-parser.c	9 Mar 2003 00:35:20 -0000	1.43
@@ -351,9 +351,7 @@
 
 static int imap_parser_literal_end(struct imap_parser *parser)
 {
-	if ((parser->flags & IMAP_PARSE_FLAG_LITERAL_SIZE) != 0)
-		parser->eol = TRUE;
-	else {
+	if ((parser->flags & IMAP_PARSE_FLAG_LITERAL_SIZE) == 0) {
 		if (parser->literal_size > parser->max_literal_size) {
 			/* too long string, abort. */
 			parser->error = "Literal size too large";
@@ -453,10 +451,12 @@
 			imap_parser_save_arg(parser, data,
 					     (size_t)parser->literal_size);
 			parser->cur_pos = (size_t)parser->literal_size;
+			parser->eol = TRUE;
 			return TRUE;
 		}
 	} else {
 		/* we want to save only literal size, not the literal itself. */
+		parser->eol = TRUE;
 		imap_parser_save_arg(parser, NULL, 0);
 		return TRUE;
 	}




More information about the dovecot-cvs mailing list