From d8bdf558c7ba173fc47a194633d9bd97af1b9c74 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 20 Mar 2013 20:24:31 +0200 Subject: [PATCH] dsync: Don't crash when requested mail doesn't have a GUID. --- src/doveadm/dsync/dsync-ibc.c | 2 +- src/doveadm/dsync/dsync-mail.h | 2 +- src/doveadm/dsync/dsync-mailbox-export.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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; -- 2.47.3