Skip to content

Commit

Permalink
virtual: If virtual_uid is not assigned skip it
Browse files Browse the repository at this point in the history
We cannot lookup mails with uid 0, so if we see
that mail has virtual uid 0, do not attempt to look it
up from index, but skip it.

Fixes Panic: file mail-index-map.c: line 549 (mail_index_map_lookup_seq_range): assertion failed: (first_uid > 0)
  • Loading branch information
cmouse committed Jul 7, 2017
1 parent 15a2661 commit 781a933
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/plugins/virtual/virtual-sync.c
Expand Up @@ -567,6 +567,10 @@ virtual_sync_mailbox_box_remove(struct virtual_sync_context *ctx,
for (; uid <= uids[i].seq2; uid++, src++) {
i_assert(src < rec_count);
i_assert(uidmap[src].real_uid == uid);
if (uidmap[src].virtual_uid == 0) {
/* has not been assigned yet */
continue;
}
if (mail_index_lookup_seq(ctx->sync_view,
uidmap[src].virtual_uid,
&vseq))
Expand Down Expand Up @@ -1040,6 +1044,10 @@ static int virtual_sync_backend_box_sync(struct virtual_sync_context *ctx,
uidmap = array_idx(&bbox->uids, 0);
for (; idx1 <= idx2; idx1++) {
vuid = uidmap[idx1].virtual_uid;
if (vuid == 0) {
/* has not been even assigned yet */
continue;
}
if (!mail_index_lookup_seq(ctx->sync_view,
vuid, &vseq)) {
/* expunged by another session,
Expand Down

0 comments on commit 781a933

Please sign in to comment.