Fix: liblttng-ctl: unreported truncations when copying strings
[lttng-tools.git] / src / lib / lttng-ctl / channel.c
index a4e910e1d93db1b02b35f75824ddfb7f714cf5a1..868e8aa68b7eb85b1dd6f206d1fb38511cfd05e0 100644 (file)
@@ -164,9 +164,14 @@ struct lttng_notification_channel *lttng_notification_channel_create(
        }
 
        if (is_root || is_in_tracing_group) {
-               lttng_ctl_copy_string(sock_path,
+               ret = lttng_strncpy(sock_path,
                                DEFAULT_GLOBAL_NOTIFICATION_CHANNEL_UNIX_SOCK,
                                LTTNG_PATH_MAX);
+               if (ret) {
+                       ret = -LTTNG_ERR_INVALID;
+                       goto error;
+               }
+
                ret = lttcomm_connect_unix_sock(sock_path);
                if (ret >= 0) {
                        fd = ret;
This page took 0.022899 seconds and 4 git commands to generate.