From: Timo Sirainen Date: Wed, 20 Mar 2013 18:24:31 +0000 (+0200) Subject: dsync: Don't crash when requested mail doesn't have a GUID. X-Git-Tag: 2.2.rc3~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d8bdf558c7ba173fc47a194633d9bd97af1b9c74;p=thirdparty%2Fdovecot%2Fcore.git dsync: Don't crash when requested mail doesn't have a GUID. --- diff --git a/src/doveadm/dsync/dsync-ibc.c b/src/doveadm/dsync/dsync-ibc.c index 428511196f..443bcc5d8b 100644 --- a/src/doveadm/dsync/dsync-ibc.c +++ b/src/doveadm/dsync/dsync-ibc.c @@ -163,7 +163,7 @@ enum dsync_ibc_send_ret dsync_ibc_send_mail_request(struct dsync_ibc *ibc, const struct dsync_mail_request *request) { - i_assert(*request->guid != '\0' || request->uid != 0); + i_assert(request->guid != NULL || request->uid != 0); T_BEGIN { ibc->v.send_mail_request(ibc, request); diff --git a/src/doveadm/dsync/dsync-mail.h b/src/doveadm/dsync/dsync-mail.h index 85584eb49d..083a8ed873 100644 --- a/src/doveadm/dsync/dsync-mail.h +++ b/src/doveadm/dsync/dsync-mail.h @@ -26,7 +26,7 @@ struct dsync_mail { }; struct dsync_mail_request { - /* either GUID="" or uid=0 */ + /* either GUID=NULL or uid=0 */ const char *guid; uint32_t uid; }; diff --git a/src/doveadm/dsync/dsync-mailbox-export.c b/src/doveadm/dsync/dsync-mailbox-export.c index dedf9c27b4..5d7270613f 100644 --- a/src/doveadm/dsync/dsync-mailbox-export.c +++ b/src/doveadm/dsync/dsync-mailbox-export.c @@ -762,7 +762,7 @@ void dsync_mailbox_export_want_mail(struct dsync_mailbox_exporter *exporter, i_assert(!exporter->auto_export_mails); - if (*request->guid == '\0') { + if (request->guid == NULL) { i_assert(request->uid > 0); seq_range_array_add(&exporter->requested_uids, request->uid); return;