Fix: illegal memory access in consumer_set_network_uri
[lttng-tools.git] / src / bin / lttng-sessiond / consumer.c
index bd019dd31da15f6953b873899f12b4dd07770c9a..a8c5fb871d9521ba7853ae1019e0ce9e9571c4a7 100644 (file)
@@ -715,7 +715,10 @@ int consumer_set_network_uri(struct consumer_output *obj,
                        goto error;
                }
 
-               strncpy(obj->subdir, tmp_path, sizeof(obj->subdir));
+               if (lttng_strncpy(obj->subdir, tmp_path, sizeof(obj->subdir))) {
+                       ret = -LTTNG_ERR_INVALID;
+                       goto error;
+               }
                DBG3("Consumer set network uri subdir path %s", tmp_path);
        }
 
This page took 0.022944 seconds and 4 git commands to generate.