X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Flive.c;h=f87e4baf0846ad9b666ac78ceb98cec6b4635247;hb=bfc3fb17b18dffde4b19c51c002d0112eca06f70;hp=a9f4f648b0bafff2e2bf4cfb0af258f8ce3135bf;hpb=a7c918ad2aefd0c540b0aa4aacace40941d94643;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c index a9f4f648b..f87e4baf0 100644 --- a/src/bin/lttng-relayd/live.c +++ b/src/bin/lttng-relayd/live.c @@ -831,10 +831,19 @@ int viewer_list_sessions(struct relay_connection *conn) buf_count = new_buf_count; } send_session = &send_session_buf[count]; - strncpy(send_session->session_name, session->session_name, - sizeof(send_session->session_name)); - strncpy(send_session->hostname, session->hostname, - sizeof(send_session->hostname)); + if (lttng_strncpy(send_session->session_name, + session->session_name, + sizeof(send_session->session_name))) { + ret = -1; + rcu_read_unlock(); + goto end_free; + } + if (lttng_strncpy(send_session->hostname, session->hostname, + sizeof(send_session->hostname))) { + ret = -1; + rcu_read_unlock(); + goto end_free; + } send_session->id = htobe64(session->id); send_session->live_timer = htobe32(session->live_timer); if (session->viewer_attached) {