X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fkernel-consumer.c;fp=src%2Fbin%2Flttng-sessiond%2Fkernel-consumer.c;h=74c4b302320de5b49926f1ff497c31b59f4fb9fa;hp=160c19f598329ec03c6d82023ad55f09bc38db03;hb=dba13f1d5dffdd2ecaa14ba8ff88c27805153016;hpb=f0218c668a86d27ff8e9ae8df7199888c5633f59 diff --git a/src/bin/lttng-sessiond/kernel-consumer.c b/src/bin/lttng-sessiond/kernel-consumer.c index 160c19f59..74c4b3023 100644 --- a/src/bin/lttng-sessiond/kernel-consumer.c +++ b/src/bin/lttng-sessiond/kernel-consumer.c @@ -52,6 +52,13 @@ static char *create_channel_path(struct consumer_output *consumer, if (ret < 0) { PERROR("snprintf kernel channel path"); goto error; + } else if (ret >= sizeof(tmp_path)) { + ERR("Kernel channel path exceeds the maximal allowed length of of %zu bytes (%i bytes required) with path \"%s%s%s\"", + sizeof(tmp_path), ret, + consumer->dst.session_root_path, + consumer->chunk_path, + consumer->subdir); + goto error; } pathname = lttng_strndup(tmp_path, sizeof(tmp_path)); if (!pathname) { @@ -75,6 +82,12 @@ static char *create_channel_path(struct consumer_output *consumer, if (ret < 0) { PERROR("snprintf kernel metadata path"); goto error; + } else if (ret >= sizeof(tmp_path)) { + ERR("Kernel channel path exceeds the maximal allowed length of of %zu bytes (%i bytes required) with path \"%s%s\"", + sizeof(tmp_path), ret, + consumer->dst.net.base_dir, + consumer->subdir); + goto error; } pathname = lttng_strndup(tmp_path, sizeof(tmp_path)); if (!pathname) {