dovecot-2.2: lib-storage: If transaction commit fails, don't try...

dovecot at dovecot.org dovecot at dovecot.org
Sun Apr 7 16:36:11 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/3c4712bcf473
changeset: 16223:3c4712bcf473
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Apr 07 16:36:00 2013 +0300
description:
lib-storage: If transaction commit fails, don't try to access garbage memory.

diffstat:

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

diffs (13 lines):

diff -r d79cf48f1072 -r 3c4712bcf473 src/lib-storage/mail-storage.c
--- a/src/lib-storage/mail-storage.c	Sun Apr 07 15:36:35 2013 +0300
+++ b/src/lib-storage/mail-storage.c	Sun Apr 07 16:36:00 2013 +0300
@@ -1825,7 +1825,8 @@
 	/* either all the saved messages get UIDs or none, because a) we
 	   failed, b) MAILBOX_TRANSACTION_FLAG_ASSIGN_UIDS not set,
 	   c) backend doesn't support it (e.g. virtual plugin) */
-	i_assert(seq_range_count(&changes_r->saved_uids) == save_count ||
+	i_assert(ret < 0 ||
+		 seq_range_count(&changes_r->saved_uids) == save_count ||
 		 array_count(&changes_r->saved_uids) == 0);
 	if (ret < 0 && changes_r->pool != NULL)
 		pool_unref(&changes_r->pool);


More information about the dovecot-cvs mailing list