From: Timo Sirainen Date: Fri, 4 Dec 2015 10:15:49 +0000 (+0200) Subject: imap: Fixed assert-crash if client disconnected at a specific command state. X-Git-Tag: 2.2.20~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89fd04f723ecf452ced3816f80ec4d719e415175;p=thirdparty%2Fdovecot%2Fcore.git imap: Fixed assert-crash if client disconnected at a specific command state. If there was a command with state=CLIENT_COMMAND_STATE_WAIT_SYNC and output stream was already detected to be closed, we crashed with: Panic: file imap-client.c: line 841 (client_check_command_hangs): assertion failed: (!have_wait_unfinished || unfinished_count > 0) --- diff --git a/src/imap/imap-client.c b/src/imap/imap-client.c index f0306a896a..3934634475 100644 --- a/src/imap/imap-client.c +++ b/src/imap/imap-client.c @@ -880,7 +880,8 @@ void client_continue_pending_input(struct client *client) if (!client_handle_input(client)) break; } - client_check_command_hangs(client); + if (!client->input->closed && !client->output->closed) + client_check_command_hangs(client); } /* Skip incoming data until newline is found,