From: Stephan Bosch Date: Wed, 14 Feb 2018 21:20:20 +0000 (+0100) Subject: lib-smtp: server: Fix segfault occurring when XCLIENT command is handled. X-Git-Tag: 2.3.9~2309 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8366c177e4901d851c94eb612633ffccaf5a9712;p=thirdparty%2Fdovecot%2Fcore.git lib-smtp: server: Fix segfault occurring when XCLIENT command is handled. Occurs only when the application (in this case LMTP) has a conn_proxy_data_updated() callback. The context parameter was the struct smtp_server_connection object itself, rather than the application context. This caused the connection object to be overwritten. --- diff --git a/src/lib-smtp/smtp-server-connection.c b/src/lib-smtp/smtp-server-connection.c index 11f4c5faa8..fab307eed8 100644 --- a/src/lib-smtp/smtp-server-connection.c +++ b/src/lib-smtp/smtp-server-connection.c @@ -1404,8 +1404,10 @@ void smtp_server_connection_set_proxy_data(struct smtp_server_connection *conn, conn->proxy_timeout_secs = proxy_data->timeout_secs; if (conn->callbacks != NULL && - conn->callbacks->conn_proxy_data_updated != NULL) - conn->callbacks->conn_proxy_data_updated(conn, proxy_data); + conn->callbacks->conn_proxy_data_updated != NULL) { + conn->callbacks-> + conn_proxy_data_updated(conn->context, proxy_data); + } } void smtp_server_connection_switch_ioloop(struct smtp_server_connection *conn)