From: Timo Sirainen Date: Wed, 10 Jul 2013 02:19:22 +0000 (+0300) Subject: pop3: Avoid assert-crash if client disconnects during LIST. X-Git-Tag: 2.2.5~78 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b8394a3bad30dcf8694e9b49edf05bee0b3aee77;p=thirdparty%2Fdovecot%2Fcore.git pop3: Avoid assert-crash if client disconnects during LIST. --- diff --git a/src/pop3/pop3-commands.c b/src/pop3/pop3-commands.c index 29e1d4474d..e0149fcecf 100644 --- a/src/pop3/pop3-commands.c +++ b/src/pop3/pop3-commands.c @@ -132,6 +132,8 @@ static void cmd_list_callback(struct client *client) struct cmd_list_context *ctx = client->cmd_context; for (; ctx->msgnum != client->messages_count; ctx->msgnum++) { + if (client->output->closed) + break; if (POP3_CLIENT_OUTPUT_FULL(client)) { /* buffer full */ return; @@ -145,8 +147,6 @@ static void cmd_list_callback(struct client *client) client_send_line(client, "%u %"PRIuUOFF_T, ctx->msgnum+1, client->message_sizes[ctx->msgnum]); - if (client->output->closed) - break; } client_send_line(client, ".");