From 4df41cadb07c7a6b6434088942c6b971ad6fafce Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 10 Sep 2019 19:53:20 -0400 Subject: [PATCH] Fix: report path truncation on addition of local uri to consumer MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Return an error whenever a session's destinatio path exceeds the maximal allowed length (LTTNG_PATH_MAX). Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/cmd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 10fd45757..14da88623 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -912,6 +912,10 @@ static enum lttng_error_code add_uri_to_consumer( ret = lttng_strncpy(consumer->dst.session_root_path, uri->dst.path, sizeof(consumer->dst.session_root_path)); + if (ret) { + ret_code = LTTNG_ERR_FATAL; + goto error; + } consumer->type = CONSUMER_DST_LOCAL; break; } -- 2.34.1