dovecot-2.2: seq_range_array_add() API change triggered a crash ...

dovecot at dovecot.org dovecot at dovecot.org
Sun Jun 24 21:30:07 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/42d1459958ec
changeset: 14678:42d1459958ec
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Jun 24 21:29:56 2012 +0300
description:
seq_range_array_add() API change triggered a crash in buggy code.

diffstat:

 src/lib-index/mail-index-transaction-finish.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (16 lines):

diff -r 737a49f472d1 -r 42d1459958ec src/lib-index/mail-index-transaction-finish.c
--- a/src/lib-index/mail-index-transaction-finish.c	Sun Jun 24 21:19:33 2012 +0300
+++ b/src/lib-index/mail-index-transaction-finish.c	Sun Jun 24 21:29:56 2012 +0300
@@ -162,8 +162,10 @@
 		if (mail_index_modseq_lookup(t->view, seq) > t->max_modseq) {
 			ret1 = mail_index_cancel_flag_updates(t, seq);
 			ret2 = mail_index_cancel_keyword_updates(t, seq);
-			if (ret1 || ret2)
-				seq_range_array_add(t->conflict_seqs, seq);
+			if (ret1 || ret2) {
+				seq_range_array_add_with_init(t->conflict_seqs,
+							      16, seq);
+			}
 		}
 	}
 	mail_index_transaction_set_log_updates(t);


More information about the dovecot-cvs mailing list