From: Timo Sirainen Date: Thu, 29 Oct 2015 13:29:24 +0000 (+0200) Subject: imap: Fixed crash in NOTIFY when there were watched namespaces that didn't support... X-Git-Tag: 2.2.20.rc1~112 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1c1e591e42f6c3cdfeeed26164f5c85d85d01877;p=thirdparty%2Fdovecot%2Fcore.git imap: Fixed crash in NOTIFY when there were watched namespaces that didn't support NOTIFY. --- diff --git a/src/imap/imap-notify.c b/src/imap/imap-notify.c index f5b001e45b..060d4001ce 100644 --- a/src/imap/imap-notify.c +++ b/src/imap/imap-notify.c @@ -245,6 +245,9 @@ static int imap_client_notify_ns(struct imap_notify_namespace *notify_ns) const struct mailbox_list_notify_rec *rec; int ret, ret2 = 1; + if (notify_ns->notify == NULL) + return 0; /* notifications not supported in this namespace */ + while ((ret = mailbox_list_notify_next(notify_ns->notify, &rec)) > 0) { if (imap_notify_match(notify_ns, rec)) T_BEGIN { ret2 = imap_notify_next(notify_ns, rec);