dovecot-2.2: imap: Fixed assert-crash in NOTIFY when using multi...

dovecot at dovecot.org dovecot at dovecot.org
Mon Sep 7 19:15:28 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/fae5feef70af
changeset: 19113:fae5feef70af
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Sep 07 22:14:18 2015 +0300
description:
imap: Fixed assert-crash in NOTIFY when using multiple namespaces.
I'm not sure why the original code was trying to add it to multiple
namespaces. A single mailbox name should be matching only a single
namespace (visible one at least). In any case we can't use
mail_namespace_find() with only partial namespaces-list, because it'll
assert-crash if it can't find a namespace for the mailbox.

diffstat:

 src/imap/cmd-notify.c |  7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diffs (17 lines):

diff -r 865405fce42e -r fae5feef70af src/imap/cmd-notify.c
--- a/src/imap/cmd-notify.c	Mon Sep 07 22:06:16 2015 +0300
+++ b/src/imap/cmd-notify.c	Mon Sep 07 22:14:18 2015 +0300
@@ -225,11 +225,8 @@
 {
 	struct mail_namespace *ns;
 
-	/* add to all matching namespaces */
-	for (ns = ctx->client->user->namespaces; ns != NULL; ns = ns->next) {
-		if (mail_namespace_find(ns, name) == ns)
-			cmd_notify_add_mailbox(ctx, ns, name, type, events);
-	}
+	ns = mail_namespace_find(ctx->client->user->namespaces, name);
+	cmd_notify_add_mailbox(ctx, ns, name, type, events);
 }
 
 static int


More information about the dovecot-cvs mailing list