From: Timo Sirainen Date: Tue, 23 Aug 2011 18:20:13 +0000 (+0300) Subject: login proxy: Fixed assert-crash on io_add() when client disconnects at a bad time. X-Git-Tag: 2.0.14~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8afdaa1bffe2f27cd4b02bf3bfbd2d297c8e648;p=thirdparty%2Fdovecot%2Fcore.git login proxy: Fixed assert-crash on io_add() when client disconnects at a bad time. --- diff --git a/src/login-common/client-common-auth.c b/src/login-common/client-common-auth.c index c4e0e1a0a3..eb2b8d1e7d 100644 --- a/src/login-common/client-common-auth.c +++ b/src/login-common/client-common-auth.c @@ -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),