X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fset_session.c;fp=src%2Fbin%2Flttng%2Fcommands%2Fset_session.c;h=1f79d6cf08e6f17c97f972a58269cb0b102362f9;hp=a428aed16ce239257253ae2f1fd7178fc4ff69e8;hb=487b253b3ec9f187b4c1b425b246e8e74e5ac309;hpb=8f3f773f82cf4ce088d7bee098b549b5567d77f8 diff --git a/src/bin/lttng/commands/set_session.c b/src/bin/lttng/commands/set_session.c index a428aed16..1f79d6cf0 100644 --- a/src/bin/lttng/commands/set_session.c +++ b/src/bin/lttng/commands/set_session.c @@ -60,6 +60,13 @@ static int set_session(void) { int ret = CMD_SUCCESS; + if (opt_session_name && strlen(opt_session_name) > NAME_MAX) { + ERR("Session name too long. Length must be lower or equal to %d", + NAME_MAX); + ret = CMD_ERROR; + goto error; + } + ret = config_init(opt_session_name); if (ret < 0) { ERR("Unable to set session name");