dovecot-2.2: lib: Fixed crash in connection API if input streams...

dovecot at dovecot.org dovecot at dovecot.org
Sat Apr 25 08:53:44 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/1b3224f0135f
changeset: 18484:1b3224f0135f
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Apr 25 11:52:02 2015 +0300
description:
lib: Fixed crash in connection API if input streams aren't used (only input fd).

diffstat:

 src/lib/connection.c |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (21 lines):

diff -r 2c5b0ad65885 -r 1b3224f0135f src/lib/connection.c
--- a/src/lib/connection.c	Sat Apr 25 11:40:23 2015 +0300
+++ b/src/lib/connection.c	Sat Apr 25 11:52:02 2015 +0300
@@ -117,6 +117,9 @@
 		conn->input = i_stream_create_fd(conn->fd_in,
 						 set->input_max_size, FALSE);
 		i_stream_set_name(conn->input, conn->name);
+		conn->io = io_add_istream(conn->input, *conn->list->v.input, conn);
+	} else {
+		conn->io = io_add(conn->fd_in, IO_READ, *conn->list->v.input, conn);
 	}
 	if (set->output_max_size != 0) {
 		conn->output = o_stream_create_fd(conn->fd_out,
@@ -124,7 +127,6 @@
 		o_stream_set_no_error_handling(conn->output, TRUE);
 		o_stream_set_name(conn->output, conn->name);
 	}
-	conn->io = io_add_istream(conn->input, *conn->list->v.input, conn);
 	if (set->input_idle_timeout_secs != 0) {
 		conn->to = timeout_add(set->input_idle_timeout_secs*1000,
 				       connection_idle_timeout, conn);


More information about the dovecot-cvs mailing list