Fix: liblttng-ctl: unreported truncations when copying strings
[lttng-tools.git] / src / lib / lttng-ctl / save.c
index 90ab941878581160f5a119390221f84f0502b1c0..7afac450d2913d077c3ea23b43e8f712f1843f0e 100644 (file)
@@ -134,8 +134,12 @@ int lttng_save_session_attr_set_output_url(
        }
 
        /* Copy string plus the NULL terminated byte. */
-       lttng_ctl_copy_string(attr->configuration_url, uris[0].dst.path,
-                       sizeof(attr->configuration_url));
+       ret = lttng_strncpy(attr->configuration_url, uris[0].dst.path,
+                           sizeof(attr->configuration_url));
+       if (ret) {
+               ret = -LTTNG_ERR_INVALID;
+               goto error;
+       }
 
 end:
 error:
This page took 0.022848 seconds and 4 git commands to generate.