dovecot-2.2: doveadm-server: Invalid parameters for some command...

dovecot at dovecot.org dovecot at dovecot.org
Wed May 6 12:47:40 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/5fce0eaa75d6
changeset: 18529:5fce0eaa75d6
user:      Timo Sirainen <tss at iki.fi>
date:      Wed May 06 15:42:31 2015 +0300
description:
doveadm-server: Invalid parameters for some commands caused crash at deinit handlers.
deinit() can be called even if init() was never called.

diffstat:

 src/doveadm/doveadm-mail-mailbox-status.c |  3 ++-
 src/doveadm/doveadm-mail-mailbox.c        |  3 ++-
 src/doveadm/doveadm-mail.h                |  3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r 956e152467de -r 5fce0eaa75d6 src/doveadm/doveadm-mail-mailbox-status.c
--- a/src/doveadm/doveadm-mail-mailbox-status.c	Wed May 06 14:14:09 2015 +0300
+++ b/src/doveadm/doveadm-mail-mailbox-status.c	Wed May 06 15:42:31 2015 +0300
@@ -214,7 +214,8 @@
 {
 	struct status_cmd_context *ctx = (struct status_cmd_context *)_ctx;
 
-	mail_search_args_unref(&ctx->search_args);
+	if (ctx->search_args != NULL)
+		mail_search_args_unref(&ctx->search_args);
 }
 
 static bool
diff -r 956e152467de -r 5fce0eaa75d6 src/doveadm/doveadm-mail-mailbox.c
--- a/src/doveadm/doveadm-mail-mailbox.c	Wed May 06 14:14:09 2015 +0300
+++ b/src/doveadm/doveadm-mail-mailbox.c	Wed May 06 15:42:31 2015 +0300
@@ -182,7 +182,8 @@
 {
 	struct list_cmd_context *ctx = (struct list_cmd_context *)_ctx;
 
-	mail_search_args_unref(&ctx->search_args);
+	if (ctx->search_args != NULL)
+		mail_search_args_unref(&ctx->search_args);
 }
 
 static struct doveadm_mail_cmd_context *cmd_mailbox_list_alloc(void)
diff -r 956e152467de -r 5fce0eaa75d6 src/doveadm/doveadm-mail.h
--- a/src/doveadm/doveadm-mail.h	Wed May 06 14:14:09 2015 +0300
+++ b/src/doveadm/doveadm-mail.h	Wed May 06 15:42:31 2015 +0300
@@ -45,7 +45,8 @@
 	   command. This is called once per each user. */
 	int (*run)(struct doveadm_mail_cmd_context *ctx,
 		   struct mail_user *mail_user);
-	/* Deinitialize the command. Called once at the end. */
+	/* Deinitialize the command. Called once at the end - even if
+	   preinit() or init() was never called. */
 	void (*deinit)(struct doveadm_mail_cmd_context *ctx);
 };
 


More information about the dovecot-cvs mailing list