]> 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)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 6 Mar 2018 05:40:09 +0000 (07:40 +0200)
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 daeba08ce6b9ff56514a16b81738442e908a5563..bf241d851f9ae11c9b4ed08ad06f7de3b41f0b51 100644 (file)
@@ -1405,8 +1405,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)