X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fcmd-2-4.c;fp=src%2Fbin%2Flttng-relayd%2Fcmd-2-4.c;h=ac6e0425877970f3da91b05911fa8dc0c644609b;hp=f420ad928ee0e4faf36c5c8f49f3df2bff734383;hb=885e05c50f81e77fc3a14a36064c4ef702127cd7;hpb=fc1465822a1075d98160bb74ae8e974ac8c010a8 diff --git a/src/bin/lttng-relayd/cmd-2-4.c b/src/bin/lttng-relayd/cmd-2-4.c index f420ad928..ac6e04258 100644 --- a/src/bin/lttng-relayd/cmd-2-4.c +++ b/src/bin/lttng-relayd/cmd-2-4.c @@ -53,8 +53,7 @@ int cmd_create_session_2_4(const struct lttng_buffer_view *payload, ERR("Session name too long"); goto error; } - strncpy(session_name, session_info.session_name, - sizeof(session_info.session_name)); + strncpy(session_name, session_info.session_name, LTTNG_PATH_MAX); len = lttng_strnlen(session_info.hostname, sizeof(session_info.hostname)); if (len == sizeof(session_info.hostname) || len >= LTTNG_HOST_NAME_MAX) { @@ -62,8 +61,7 @@ int cmd_create_session_2_4(const struct lttng_buffer_view *payload, ERR("Session name too long"); goto error; } - strncpy(hostname, session_info.hostname, - sizeof(session_info.hostname)); + strncpy(hostname, session_info.hostname, LTTNG_HOST_NAME_MAX); *live_timer = be32toh(session_info.live_timer); *snapshot = be32toh(session_info.snapshot);