From: Timo Sirainen Date: Fri, 25 Mar 2011 22:40:58 +0000 (+0200) Subject: dsync: Fixed handling expunges of last message when it didn't have a known GUID. X-Git-Tag: 2.0.12~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=abd042f102d768b6cf3a20606566afc66c767a46;p=thirdparty%2Fdovecot%2Fcore.git dsync: Fixed handling expunges of last message when it didn't have a known GUID. --- 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;