]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mail_index_lookup_seq*() could have returned wrong sequences with transaction views.
authorTimo Sirainen <tss@iki.fi>
Thu, 28 Aug 2008 06:33:37 +0000 (09:33 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 28 Aug 2008 06:33:37 +0000 (09:33 +0300)
This caused assert-crashes in recent flag handling for mbox and maildir.

--HG--
branch : HEAD

src/lib-index/mail-index-transaction-view.c

index f40b6912c9f1a00f00b22c74214b75a1f51287cf..2286808c43907e46a71fa609595a8ccc2de5cbfe 100644 (file)
@@ -127,9 +127,9 @@ static void tview_lookup_seq_range(struct mail_index_view *view,
        if (*first_seq_r == 0) {
                seq = tview->t->first_new_seq;
                for (; seq <= tview->t->last_new_seq; seq++) {
+                       rec = mail_index_transaction_lookup(tview->t, seq);
                        if (first_uid <= rec->uid)
                                break;
-                       rec = mail_index_transaction_lookup(tview->t, seq);
                }
                if (seq > tview->t->last_new_seq) {
                        /* no messages in range */