From aaabc543e42ced7c4baa490f052fd4a17ca25f89 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 16 Jul 2020 12:39:20 -0400 Subject: [PATCH] Fix: relayd: send_viewer_streams sends stack data in padding MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit A single stack-allocated instance of `struct lttng_viewer_stream` is used to send the various streams to the live viewer. This structure contains a path and channel name which remain uninitialized beyond the null terminator. The structure is zeroed on every iteration. Signed-off-by: Jérémie Galarneau Change-Id: I1c60ee18e01e8f56157f0fe44bd3bd64b1194703 --- src/bin/lttng-relayd/live.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c index 37c546452..9074f24f3 100644 --- a/src/bin/lttng-relayd/live.c +++ b/src/bin/lttng-relayd/live.c @@ -192,7 +192,6 @@ ssize_t send_viewer_streams(struct lttcomm_sock *sock, uint64_t session_id, unsigned int ignore_sent_flag) { ssize_t ret; - struct lttng_viewer_stream send_stream; struct lttng_ht_iter iter; struct relay_viewer_stream *vstream; @@ -201,6 +200,7 @@ ssize_t send_viewer_streams(struct lttcomm_sock *sock, cds_lfht_for_each_entry(viewer_streams_ht->ht, &iter.iter, vstream, stream_n.node) { struct ctf_trace *ctf_trace; + struct lttng_viewer_stream send_stream = {}; health_code_update(); -- 2.34.1