Fix: illegal memory access in cmd_snapshot_record
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.c
index 7c58601531376d7a5879d21896685fc6e986433a..9cd1920738cec1809b7999bf455211cd1bda5e16 100644 (file)
@@ -3437,8 +3437,12 @@ int cmd_snapshot_record(struct ltt_session *session,
 
                        /* Use temporary name. */
                        if (*output->name != '\0') {
-                               strncpy(tmp_output.name, output->name,
-                                               sizeof(tmp_output.name));
+                               if (lttng_strncpy(tmp_output.name, output->name,
+                                               sizeof(tmp_output.name))) {
+                                       ret = LTTNG_ERR_INVALID;
+                                       rcu_read_unlock();
+                                       goto error;
+                               }
                        }
 
                        tmp_output.nb_snapshot = session->snapshot.nb_snapshot;
This page took 0.028046 seconds and 4 git commands to generate.