]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3: Avoid assert-crash if client disconnects during LIST.
authorTimo Sirainen <tss@iki.fi>
Wed, 10 Jul 2013 02:19:22 +0000 (05:19 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 10 Jul 2013 02:19:22 +0000 (05:19 +0300)
src/pop3/pop3-commands.c

index 29e1d4474de411da1a3ff4cc5c4281f74ab6eca8..e0149fcecf8c9d06d7a4abbd78a91e37531221d0 100644 (file)
@@ -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, ".");