]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3: Don't crash if client disconnects in output handler.
authorTimo Sirainen <tss@iki.fi>
Tue, 19 Oct 2010 19:20:18 +0000 (20:20 +0100)
committerTimo Sirainen <tss@iki.fi>
Tue, 19 Oct 2010 19:20:18 +0000 (20:20 +0100)
src/pop3/pop3-client.c

index 66d4eb17eef0458f35399d3e60018306a979555b..125aa60d6983314fa67ca9db86b1688f19f7aae5 100644 (file)
@@ -662,8 +662,12 @@ static int client_output(struct client *client)
                        client->io = io_add(i_stream_get_fd(client->input),
                                            IO_READ, client_input, client);
                }
-               if (client->io != NULL && client->waiting_input)
-                       client_input(client);
+               if (client->io != NULL && client->waiting_input) {
+                       if (!client_handle_input(client)) {
+                               /* client got destroyed */
+                               return 1;
+                       }
+               }
        }
 
        o_stream_uncork(client->output);