dovecot-2.2: dsync: Don't crash when requested mail doesn't have...

dovecot at dovecot.org dovecot at dovecot.org
Wed Mar 20 20:24:42 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/19ce7403114f
changeset: 16067:19ce7403114f
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Mar 20 20:24:31 2013 +0200
description:
dsync: Don't crash when requested mail doesn't have a GUID.

diffstat:

 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(-)

diffs (36 lines):

diff -r fb934cb4a37e -r 19ce7403114f src/doveadm/dsync/dsync-ibc.c
--- a/src/doveadm/dsync/dsync-ibc.c	Wed Mar 20 20:17:15 2013 +0200
+++ b/src/doveadm/dsync/dsync-ibc.c	Wed Mar 20 20:24:31 2013 +0200
@@ -163,7 +163,7 @@
 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 -r fb934cb4a37e -r 19ce7403114f src/doveadm/dsync/dsync-mail.h
--- a/src/doveadm/dsync/dsync-mail.h	Wed Mar 20 20:17:15 2013 +0200
+++ b/src/doveadm/dsync/dsync-mail.h	Wed Mar 20 20:24:31 2013 +0200
@@ -26,7 +26,7 @@
 };
 
 struct dsync_mail_request {
-	/* either GUID="" or uid=0 */
+	/* either GUID=NULL or uid=0 */
 	const char *guid;
 	uint32_t uid;
 };
diff -r fb934cb4a37e -r 19ce7403114f src/doveadm/dsync/dsync-mailbox-export.c
--- a/src/doveadm/dsync/dsync-mailbox-export.c	Wed Mar 20 20:17:15 2013 +0200
+++ b/src/doveadm/dsync/dsync-mailbox-export.c	Wed Mar 20 20:24:31 2013 +0200
@@ -762,7 +762,7 @@
 
 	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;


More information about the dovecot-cvs mailing list