Replace strncpy by lttng_strncpy in utils_stream_file_name()
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 4 Jun 2018 15:27:08 +0000 (11:27 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 4 Jun 2018 16:00:13 +0000 (12:00 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/utils.c

index 7d018b53b1b9430cfb427761f9d4b4a4573e0334..e9fb552ac1011fc37569865baacb6fdbe29ca2de 100644 (file)
@@ -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;
This page took 0.027054 seconds and 5 git commands to generate.