[lttng-dev] [PATCH lttng-tools] Fix: Unchecked session pointer when destroying a connection in relayd

David Goulet dgoulet at efficios.com
Tue Mar 4 14:02:33 EST 2014


Merged! Thanks

Master and backported to stable-2.4

On 04 Mar (13:45:17), Jérémie Galarneau wrote:
> An unknown command currently crashes the relay daemon since
> destroy_connection calls destroy_session without checking whether
> or not a session is associated with the connection.
> 
> Signed-off-by: Jérémie Galarneau <jeremie.galarneau at efficios.com>
> ---
>  src/bin/lttng-relayd/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c
> index 53eaca2..a93151a 100644
> --- a/src/bin/lttng-relayd/main.c
> +++ b/src/bin/lttng-relayd/main.c
> @@ -2389,7 +2389,7 @@ static void destroy_connection(struct lttng_ht *relay_connections_ht,
>  	connection_delete(relay_connections_ht, conn);
>  
>  	/* For the control socket, we try to destroy the session. */
> -	if (conn->type == RELAY_CONTROL) {
> +	if (conn->type == RELAY_CONTROL && conn->session) {
>  		destroy_session(conn->session, conn->sessions_ht);
>  	}
>  
> -- 
> 1.9.0
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 603 bytes
Desc: Digital signature
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20140304/d259a82e/attachment.pgp>


More information about the lttng-dev mailing list