Fix: report path truncation on addition of local uri to consumer
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 10 Sep 2019 23:53:20 +0000 (19:53 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 10 Sep 2019 23:53:20 +0000 (19:53 -0400)
Return an error whenever a session's destinatio path exceeds the
maximal allowed length (LTTNG_PATH_MAX).

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/cmd.c

index 10fd45757397257d84a4da8c48de3385964c9fcd..14da886238cfbfd90f7e33d4dc05c1c740aca049 100644 (file)
@@ -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;
        }
This page took 0.02834 seconds and 4 git commands to generate.