Blame SOURCES/dovecot-2.3.13-CVE_2020_24386-part3.patch

2c808a
From c7d158681fabdb3044bd213c332e489b46625a3b Mon Sep 17 00:00:00 2001
2c808a
From: Timo Sirainen <timo.sirainen@open-xchange.com>
2c808a
Date: Mon, 24 Aug 2020 19:10:10 +0300
2c808a
Subject: [PATCH] imap: Delay initializing client IO until
2c808a
 client_create_finish()
2c808a
2c808a
This helps writing unit tests.
2c808a
---
2c808a
 src/imap/imap-client.c | 2 +-
2c808a
 1 file changed, 1 insertion(+), 1 deletion(-)
2c808a
2c808a
diff --git a/src/imap/imap-client.c b/src/imap/imap-client.c
2c808a
index 95e57dbf53..c8ffeafc43 100644
2c808a
--- a/src/imap/imap-client.c
2c808a
+++ b/src/imap/imap-client.c
2c808a
@@ -143,7 +143,6 @@ struct client *client_create(int fd_in, int fd_out,
2c808a
 	o_stream_set_flush_callback(client->output, client_output, client);
2c808a
 
2c808a
 	p_array_init(&client->module_contexts, client->pool, 5);
2c808a
-	client->io = io_add_istream(client->input, client_input, client);
2c808a
         client->last_input = ioloop_time;
2c808a
 	client->to_idle = timeout_add(CLIENT_IDLE_TIMEOUT_MSECS,
2c808a
 				      client_idle_timeout, client);
2c808a
@@ -228,6 +227,7 @@ int client_create_finish(struct client *client, const char **error_r)
2c808a
 		return -1;
2c808a
 	mail_namespaces_set_storage_callbacks(client->user->namespaces,
2c808a
 					      &mail_storage_callbacks, client);
2c808a
+	client->io = io_add_istream(client->input, client_input, client);
2c808a
 
2c808a
 	client->v.init(client);
2c808a
 	return 0;