From abd042f102d768b6cf3a20606566afc66c767a46 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 26 Mar 2011 00:40:58 +0200 Subject: [PATCH] dsync: Fixed handling expunges of last message when it didn't have a known GUID. --- src/dsync/dsync-worker-local.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/dsync/dsync-worker-local.c b/src/dsync/dsync-worker-local.c index 95b3946eab..b168e57f76 100644 --- a/src/dsync/dsync-worker-local.c +++ b/src/dsync/dsync-worker-local.c @@ -925,6 +925,7 @@ iter_local_mailbox_next_expunge(struct local_dsync_worker_msg_iter *iter, { struct mailbox *box = iter->mail->box; struct mailbox_status status; + const uint8_t *guid_128; const struct mailbox_expunge_rec *expunges; unsigned int count; @@ -935,9 +936,11 @@ iter_local_mailbox_next_expunge(struct local_dsync_worker_msg_iter *iter, memset(msg_r, 0, sizeof(*msg_r)); str_truncate(iter->tmp_guid_str, 0); - binary_to_hex_append(iter->tmp_guid_str, - expunges[iter->expunge_idx].guid_128, - MAIL_GUID_128_SIZE); + guid_128 = expunges[iter->expunge_idx].guid_128; + if (!mail_guid_128_is_empty(guid_128)) { + binary_to_hex_append(iter->tmp_guid_str, guid_128, + MAIL_GUID_128_SIZE); + } msg_r->guid = str_c(iter->tmp_guid_str); msg_r->uid = expunges[iter->expunge_idx].uid; msg_r->flags = DSYNC_MAIL_FLAG_EXPUNGED; -- 2.47.3