]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: server: Fix segfault occurring when XCLIENT command is handled.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Wed, 14 Feb 2018 21:20:20 +0000 (22:20 +0100)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Wed, 14 Feb 2018 21:47:03 +0000 (22:47 +0100)
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.

src/lib-smtp/smtp-server-connection.c

index 11f4c5faa8bd851549e3403516828c0e9d7f3776..fab307eed8ffe521fc08fd4428bca1c2b9636a60 100644 (file)
@@ -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)