dovecot-2.2: lib-mail: Fixed infinite loop in message-parser if ...

dovecot at dovecot.org dovecot at dovecot.org
Tue Nov 5 20:11:22 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/aa1aede0f7f2
changeset: 16935:aa1aede0f7f2
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Nov 05 20:11:11 2013 +0200
description:
lib-mail: Fixed infinite loop in message-parser if message ends with --boundary+CR
Thanks to Tomasz Potega for finding this.

diffstat:

 src/lib-mail/message-parser.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 5c876ed0c3e0 -r aa1aede0f7f2 src/lib-mail/message-parser.c
--- a/src/lib-mail/message-parser.c	Tue Nov 05 13:12:25 2013 +0200
+++ b/src/lib-mail/message-parser.c	Tue Nov 05 20:11:11 2013 +0200
@@ -403,7 +403,7 @@
 	} else if (boundary_start == 0) {
 		/* no linefeeds in this block. we can just skip it. */
 		ret = 0;
-		if (block_r->data[block_r->size-1] == '\r') {
+		if (block_r->data[block_r->size-1] == '\r' && !ctx->eof) {
 			/* this may be the beginning of the \r\n--boundary */
 			block_r->size--;
 		}


More information about the dovecot-cvs mailing list