[dovecot-cvs] dovecot/src/lib-mail message-parser.c,1.67,1.68

cras at dovecot.org cras at dovecot.org
Tue Jul 12 23:45:29 EEST 2005


Update of /var/lib/cvs/dovecot/src/lib-mail
In directory talvi:/tmp/cvs-serv11126/lib-mail

Modified Files:
	message-parser.c 
Log Message:
Boundary line could have been included in next message part's headers.



Index: message-parser.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-mail/message-parser.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- message-parser.c	13 Jan 2005 18:04:34 -0000	1.67
+++ message-parser.c	12 Jul 2005 20:45:27 -0000	1.68
@@ -526,7 +526,7 @@
 	struct message_boundary *boundary;
 	const unsigned char *msg;
 	size_t size;
-	int end_boundary;
+	int end_boundary, i, line_count = 1;
 
 	boundary = message_find_boundary(parser_ctx->input, boundaries,
 					 boundary_size, has_nuls);
@@ -543,6 +543,7 @@
 	}
 	if (msg[0] == '\n') {
 		msg++; size--;
+		line_count++;
 	}
 	i_assert(size >= 2 && msg[0] == '-' && msg[1] == '-');
 	msg += 2; size -= 2;
@@ -555,9 +556,12 @@
 	   change boundary_size to be the found boundary's parent part */
 	boundary_size = &boundary->part->body_size;
 
-	/* skip the rest of the line */
-	message_skip_line(parser_ctx->input, boundary_size,
-			  !end_boundary, has_nuls);
+	/* skip the rest of the line. we probably have to skip two lines
+	   because input is positioned to end of boundary's previous line */
+	for (i = 0; i < line_count; i++) {
+		message_skip_line(parser_ctx->input, boundary_size,
+				  !end_boundary, has_nuls);
+	}
 
 	if (end_boundary) {
 		/* skip the footer */



More information about the dovecot-cvs mailing list