changeset 19947:7b498de3bdba

lazy-expunge: Fixed crash if lazy_expunge-namespace was not found.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Mon, 21 Mar 2016 22:10:08 +0900
parents 7ffdbac8e3ae
children c01499a4ca0f
files src/plugins/lazy-expunge/lazy-expunge-plugin.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Mon Mar 21 21:51:49 2016 +0900
+++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Mon Mar 21 22:10:08 2016 +0900
@@ -445,8 +445,10 @@
 		/* see if it's set to namespace root itself. in that case we
 		   store all the expunged mails to the namespace root. */
 		luser->lazy_ns = mail_namespace_find_prefix_nosep(namespaces, luser->env);
-		luser->lazy_mailbox_vname = p_strndup(namespaces->user->pool,
-			luser->lazy_ns->prefix, luser->lazy_ns->prefix_len-1);
+		if (luser->lazy_ns != NULL) {
+			luser->lazy_mailbox_vname = p_strndup(namespaces->user->pool,
+				luser->lazy_ns->prefix, luser->lazy_ns->prefix_len-1);
+		}
 	}
 	if (luser->lazy_ns == NULL)
 		i_fatal("lazy_expunge: Unknown namespace: '%s'", luser->env);