Fix: illegal memory access in consumer_set_network_uri
[lttng-tools.git] / src / bin / lttng-sessiond / consumer.c
index 3c08041b0110f340aaec10daf7fdd1c9e44c9413..5b1f789d889d420f743d400fc4c8a704222bd000 100644 (file)
@@ -713,7 +713,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.02679 seconds and 4 git commands to generate.