dovecot-2.2: imap: Fixed URLFETCH assert-crashes due to output_c...

dovecot at dovecot.org dovecot at dovecot.org
Mon May 6 20:21:38 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/01560ee1a4b8
changeset: 16339:01560ee1a4b8
user:      Timo Sirainen <tss at iki.fi>
date:      Mon May 06 20:15:58 2013 +0300
description:
imap: Fixed URLFETCH assert-crashes due to output_cmd_lock not being cleared.

diffstat:

 src/imap/cmd-urlfetch.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r 113cb77256a7 -r 01560ee1a4b8 src/imap/cmd-urlfetch.c
--- a/src/imap/cmd-urlfetch.c	Mon May 06 19:51:07 2013 +0300
+++ b/src/imap/cmd-urlfetch.c	Mon May 06 20:15:58 2013 +0300
@@ -43,7 +43,14 @@
 		imap_urlauth_fetch_deinit(&ctx->ufetch);
 
 	if (ctx->failed) {
-		client_send_internal_error(cmd);
+		if (cmd->client->output_cmd_lock == cmd) {
+			/* failed in the middle of a literal.
+			   we need to disconnect. */
+			cmd->client->output_cmd_lock = NULL;
+			client_disconnect(cmd->client, "URLFETCH failed");
+		} else {
+			client_send_internal_error(cmd);
+		}
 		return;
 	}
 
@@ -147,12 +154,12 @@
 		client_send_line(client, ")");
 	else
 		client_send_line(client, "");
+	client->output_cmd_lock = NULL;
 
 	if (imap_urlauth_fetch_continue(ctx->ufetch)) {
 		/* waiting for imap urlauth service */
 		cmd->state = CLIENT_COMMAND_STATE_WAIT_EXTERNAL;
 		cmd->func = cmd_urlfetch_cancel;
-		client->output_cmd_lock = NULL;
 
 		/* retrieve next url */
 		return FALSE;


More information about the dovecot-cvs mailing list