]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-auth-client: auth-master - Fix crash if failing to connect to socket
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 16 Jan 2025 13:44:50 +0000 (15:44 +0200)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 16 Jan 2025 13:54:19 +0000 (13:54 +0000)
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)

src/lib-auth-client/auth-master.c

index 6f849f51d149a9f11bc6ab5e22f3689d8ecf17b7..7854acbeb3c6697c2ee4006f76889a4ccfa5dc40 100644 (file)
@@ -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);
                }