From: Jérémie Galarneau Date: Mon, 4 Jun 2018 15:27:08 +0000 (-0400) Subject: Replace strncpy by lttng_strncpy in utils_stream_file_name() X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=commitdiff_plain;h=072ede5941482a4d2727d2b41af7ea2557fed4d9 Replace strncpy by lttng_strncpy in utils_stream_file_name() Signed-off-by: Jérémie Galarneau --- 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;