]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Don't crash when requested mail doesn't have a GUID.
authorTimo Sirainen <tss@iki.fi>
Wed, 20 Mar 2013 18:24:31 +0000 (20:24 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 20 Mar 2013 18:24:31 +0000 (20:24 +0200)
src/doveadm/dsync/dsync-ibc.c
src/doveadm/dsync/dsync-mail.h
src/doveadm/dsync/dsync-mailbox-export.c

index 428511196fd09c3d41b8ab0eefeb9f932c6c9f7f..443bcc5d8bedf0465b8be5a30f44a2f22702a116 100644 (file)
@@ -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);
index 85584eb49d3a5af5be8e7f0ba4bb0d5bc1c0ab1d..083a8ed8731b3e99ad3ddd211d7ec47634de1575 100644 (file)
@@ -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;
 };
index dedf9c27b47a38bb0259d4f55637d7bdf5dfe8fa..5d7270613fe78420282eda4d98a75cccf1eb9ced 100644 (file)
@@ -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;