]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login proxy: Fixed assert-crash on io_add() when client disconnects at a bad time.
authorTimo Sirainen <tss@iki.fi>
Tue, 23 Aug 2011 18:20:13 +0000 (21:20 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 23 Aug 2011 18:20:13 +0000 (21:20 +0300)
src/login-common/client-common-auth.c

index c4e0e1a0a365973e487e3634a1d7701955904a00..eb2b8d1e7df615345815d85624ce49bfd93f3535 100644 (file)
@@ -127,6 +127,15 @@ void client_proxy_finish_destroy_client(struct client *client)
 {
        string_t *str = t_str_new(128);
 
+       if (client->input->closed) {
+               /* input stream got closed in client_send_raw_data().
+                  In most places we don't have to check for this explicitly,
+                  but login_proxy_detach() attempts to get and use the
+                  istream's fd, which is now -1. */
+               client_destroy(client, "Disconnected");
+               return;
+       }
+
        str_printfa(str, "proxy(%s): started proxying to %s:%u",
                    client->virtual_user,
                    login_proxy_get_host(client->login_proxy),