dovecot-2.2: lib-storage: Fixed crash in mailbox list index noti...

dovecot at dovecot.org dovecot at dovecot.org
Wed Sep 9 08:32:48 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/390d55d627a8
changeset: 19140:390d55d627a8
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Sep 09 11:31:41 2015 +0300
description:
lib-storage: Fixed crash in mailbox list index notifying caused by fa979ccfa34c

diffstat:

 src/lib-storage/list/mailbox-list-index-notify.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 8687e24d9019 -r 390d55d627a8 src/lib-storage/list/mailbox-list-index-notify.c
--- a/src/lib-storage/list/mailbox-list-index-notify.c	Tue Sep 08 19:28:31 2015 +0300
+++ b/src/lib-storage/list/mailbox-list-index-notify.c	Wed Sep 09 11:31:41 2015 +0300
@@ -686,7 +686,7 @@
 		STATUS_UIDVALIDITY | STATUS_UIDNEXT | STATUS_MESSAGES |
 		STATUS_UNSEEN | STATUS_HIGHESTMODSEQ;
 	struct mailbox_list_notify_rec *rec;
-	struct mailbox_notify_node *nnode;
+	struct mailbox_notify_node *nnode, empty_node;
 	struct mailbox_status status;
 
 	if (!mailbox_list_index_notify_lookup(inotify, inotify->view,
@@ -696,7 +696,12 @@
 	/* get the old status */
 	nnode = mailbox_list_notify_tree_lookup(inotify->tree,
 						rec->storage_name);
-	if (nnode == NULL || nnode->uidvalidity != status.uidvalidity)
+	if (nnode == NULL) {
+		/* mailbox didn't exist earlier - report all events as new */
+		memset(&empty_node, 0, sizeof(empty_node));
+		nnode = &empty_node;
+	}
+	if (nnode->uidvalidity != status.uidvalidity)
 		rec->events |= MAILBOX_LIST_NOTIFY_UIDVALIDITY;
 	if (nnode->uidnext != status.uidnext)
 		rec->events |= MAILBOX_LIST_NOTIFY_APPENDS;


More information about the dovecot-cvs mailing list