# HG changeset patch # User Timo Sirainen # Date 1263912707 -7200 # Node ID 57eb71a78375668565bba6e35c129be873dbf24f # Parent b6ea12ec49c891f25589fe331a3c4d441473e0cd mail_index_update_flags_range(): Fixed out-of-bounds read. diff -r b6ea12ec49c8 -r 57eb71a78375 src/lib-index/mail-index-transaction-update.c --- a/src/lib-index/mail-index-transaction-update.c Tue Jan 19 16:22:10 2010 +0200 +++ b/src/lib-index/mail-index-transaction-update.c Tue Jan 19 16:51:47 2010 +0200 @@ -523,7 +523,7 @@ /* merge everything */ idx = first_idx == 0 ? 0 : first_idx - 1; max = I_MIN(t->last_update_idx + 1, count); - for (; idx < max; ) { + for (; idx+1 < max; ) { if (updates[idx].uid2 + 1 == updates[idx+1].uid1 && updates[idx].add_flags == updates[idx+1].add_flags && updates[idx].remove_flags == updates[idx+1].remove_flags) {