X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Futils.c;h=e9fb552ac1011fc37569865baacb6fdbe29ca2de;hb=3e25d926e1c03011c68430e3a358d1e9a10ca9ab;hp=7d018b53b1b9430cfb427761f9d4b4a4573e0334;hpb=a5df8828164272c26e88028b00e6e1ec88ee222d;p=lttng-tools.git diff --git a/src/common/utils.c b/src/common/utils.c index 7d018b53b..e9fb552ac 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -755,7 +755,11 @@ static int utils_stream_file_name(char *path, strncpy(path, path_name_suffix, PATH_MAX - 1); path[PATH_MAX - 1] = '\0'; } else { - strncpy(path, full_path, PATH_MAX - 1); + ret = lttng_strncpy(path, full_path, PATH_MAX); + if (ret) { + ERR("Failed to copy stream file name"); + goto error_free_suffix; + } } path[PATH_MAX - 1] = '\0'; ret = 0;