Mercurial > dovecot > core-2.2
changeset 16623:0cab916b28c6
lib-auth: Don't crash in auth_master_user_list_*() if socket can't be connected to.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 30 Jul 2013 13:09:52 +0300 |
parents | a6736e42301e |
children | 2470bb9106b0 |
files | src/lib-auth/auth-master.c |
diffstat | 1 files changed, 12 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-auth/auth-master.c Mon Jul 29 23:22:46 2013 +0300 +++ b/src/lib-auth/auth-master.c Tue Jul 30 13:09:52 2013 +0300 @@ -352,13 +352,15 @@ io_loop_set_current(conn->prev_ioloop); lib_signals_reset_ioloop(); } - io_loop_set_current(conn->ioloop); + if (conn->ioloop != NULL) { + io_loop_set_current(conn->ioloop); - timeout_remove(&conn->to); - io_remove(&conn->io); - i_stream_unref(&conn->input); - o_stream_unref(&conn->output); - io_loop_destroy(&conn->ioloop); + timeout_remove(&conn->to); + io_remove(&conn->io); + i_stream_unref(&conn->input); + o_stream_unref(&conn->output); + io_loop_destroy(&conn->ioloop); + } if ((conn->flags & AUTH_MASTER_FLAG_NO_IDLE_TIMEOUT) == 0) { if (conn->prev_ioloop == NULL) @@ -685,13 +687,16 @@ { const char *line; + if (ctx->failed) + return NULL; + /* try to read already buffered input */ line = i_stream_next_line(ctx->conn->input); if (line != NULL) { T_BEGIN { auth_handle_line(ctx->conn, line); } T_END; - } else if (!ctx->failed) { + } else { /* wait for more data */ io_loop_run(ctx->conn->ioloop); }