if (ret < 0) {
PERROR("snprintf file url");
goto parse_error;
+ } else if (ret >= sizeof(url)) {
+ PERROR("snprintf file url is too long");
+ goto parse_error;
+
}
ctrl_url = url;
}
if (ctrl_uris[0].dtype == LTTNG_DST_PATH &&
(data_url && *data_url != '\0')) {
- ERR("Can not have a data URL when destination is file://");
+ ERR("Cannot have a data URL when destination is file://");
goto error;
}
set_default_uri_attr(&data_uris[0], LTTNG_STREAM_DATA);
- ret = compare_destination(&ctrl_uris[0], &data_uris[0]);
- if (ret != 0) {
- ERR("Control and data destination mismatch");
- goto error;
+ if (ctrl_uris) {
+ ret = compare_destination(&ctrl_uris[0], &data_uris[0]);
+ if (ret != 0) {
+ ERR("Control and data destination mismatch");
+ goto error;
+ }
}
}