]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Fixed assert-crash if client disconnected at a specific command state.
authorTimo Sirainen <tss@iki.fi>
Fri, 4 Dec 2015 10:15:49 +0000 (12:15 +0200)
committerTimo Sirainen <tss@iki.fi>
Fri, 4 Dec 2015 10:15:49 +0000 (12:15 +0200)
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)

src/imap/imap-client.c

index f0306a896a9a11fa9f087fa586fd670b5615a2bf..393463447589f05c8142a0775eb252e0f1b33fe3 100644 (file)
@@ -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,