From: Jérémie Galarneau Date: Tue, 10 Sep 2019 23:53:20 +0000 (-0400) Subject: Fix: report path truncation on addition of local uri to consumer X-Git-Tag: v2.11.0-rc4~66 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=faff536a396436792e12d3526c1fd51068f451ac;p=lttng-tools.git Fix: report path truncation on addition of local uri to consumer Return an error whenever a session's destinatio path exceeds the maximal allowed length (LTTNG_PATH_MAX). Signed-off-by: Jérémie Galarneau --- 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; }