]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Fixed modseq updates when modseq was over 32bits long
authorTimo Sirainen <tss@iki.fi>
Wed, 4 Sep 2013 19:16:02 +0000 (22:16 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 4 Sep 2013 19:16:02 +0000 (22:16 +0300)
src/lib-index/mail-index-sync-update.c
src/lib-index/mail-transaction-log-file.c

index 56b546707fb7f120e88c856bd304dcfa9800ad90..e460b49f4a53eee4a8a8bb199472c15363b94839 100644 (file)
@@ -322,7 +322,7 @@ sync_modseq_update(struct mail_index_sync_map_ctx *ctx,
                else if (!mail_index_lookup_seq(view, u->uid, &seq))
                        continue;
 
-               min_modseq = ((uint64_t)u->modseq_high32 >> 32) |
+               min_modseq = ((uint64_t)u->modseq_high32 << 32) |
                        u->modseq_low32;
                if (highest_modseq < min_modseq)
                        highest_modseq = min_modseq;
index 4e0bcfa4d73128e76dc214a86a68911e7b929a79..2b666156ea65742e8dd19d4b14df11f93f5d539c 100644 (file)
@@ -1031,7 +1031,7 @@ void mail_transaction_update_modseq(const struct mail_transaction_header *hdr,
 
                end = CONST_PTR_OFFSET(data, trans_size - sizeof(*hdr));
                for (rec = data; rec < end; rec++) {
-                       uint64_t modseq = ((uint64_t)rec->modseq_high32 >> 32) |
+                       uint64_t modseq = ((uint64_t)rec->modseq_high32 << 32) |
                                rec->modseq_low32;
                        if (*cur_modseq < modseq)
                                *cur_modseq = modseq;