Fix: liblttng-ctl: unreported truncations when copying strings
[lttng-tools.git] / src / lib / lttng-ctl / save.c
index 8302226644f89f708394e78f6a51ddf2eba061c2..dfd4eb3f87de9598ae4f34dfba34ba50d9460994 100644 (file)
@@ -144,8 +144,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.026692 seconds and 4 git commands to generate.