dovecot-2.0: lmtp: Fixed crash when multiple mails were saved an...

dovecot at dovecot.org dovecot at dovecot.org
Sat Apr 10 07:25:23 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/cc00fdf1943b
changeset: 11123:cc00fdf1943b
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Apr 10 07:25:19 2010 +0300
description:
lmtp: Fixed crash when multiple mails were saved and second one failed.

diffstat:

 src/lmtp/commands.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r 8f67eaebfc17 -r cc00fdf1943b src/lmtp/commands.c
--- a/src/lmtp/commands.c	Sat Apr 10 06:54:05 2010 +0300
+++ b/src/lmtp/commands.c	Sat Apr 10 07:25:19 2010 +0300
@@ -606,13 +606,18 @@
 
 	/* save the message to the first recipient's mailbox */
 	src_mail = client->state.raw_mail;
-	if (!client_deliver_next(client, src_mail))
+	if (!client_deliver_next(client, src_mail)) {
+		/* nothing got saved */
+		i_assert(client->state.first_saved_mail == NULL);
 		return;
+	}
 
 	if (client->state.first_saved_mail == NULL)
 		mail_user_unref(&client->state.dest_user);
-	else
+	else {
+		client->state.dest_user = NULL;
 		src_mail = client->state.first_saved_mail;
+	}
 
 	/* use the first saved message to save it elsewhere too.
 	   this might allow hard linking the files. */


More information about the dovecot-cvs mailing list