From: Timo Sirainen Date: Thu, 16 Jan 2025 13:44:50 +0000 (+0200) Subject: lib-auth-client: auth-master - Fix crash if failing to connect to socket X-Git-Tag: 2.4.0~1359 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f9bda94b256a9af9e343046dfa2d3fa5358ca901;p=thirdparty%2Fdovecot%2Fcore.git lib-auth-client: auth-master - Fix crash if failing to connect to socket auth_master_unset_io() would be called twice: once by auth_master_run_cmd_pre() and again by auth_master_run_cmd_post(), which attempts to add the idle timeout again. Fixes: Panic: file auth-master.c: line 440 (auth_master_unset_io): assertion failed: (conn->to == NULL) --- diff --git a/src/lib-auth-client/auth-master.c b/src/lib-auth-client/auth-master.c index 6f849f51d1..7854acbeb3 100644 --- a/src/lib-auth-client/auth-master.c +++ b/src/lib-auth-client/auth-master.c @@ -436,8 +436,7 @@ static void auth_master_unset_io(struct auth_master_connection *conn) if ((conn->flags & AUTH_MASTER_FLAG_NO_IDLE_TIMEOUT) == 0) { if (conn->prev_ioloop == NULL) auth_connection_close(conn); - else { - i_assert(conn->to == NULL); + else if (conn->to == NULL) { conn->to = timeout_add(1000*AUTH_MASTER_IDLE_SECS, auth_idle_timeout, conn); }