@@ -70,17+78,31 @@ int cmd_create_session_2_11(const struct lttng_buffer_view *payload,
ret = -ENAMETOOLONG;
ERR("Length of session name (%" PRIu32 " bytes) received in create_session command exceeds maximum length (%d bytes)", header.session_name_len, LTTNG_NAME_MAX);
goto error;
ret = -ENAMETOOLONG;
ERR("Length of session name (%" PRIu32 " bytes) received in create_session command exceeds maximum length (%d bytes)", header.session_name_len, LTTNG_NAME_MAX);
goto error;
+ } else if (header.session_name_len == 0) {
+ ret = -EINVAL;
+ ERR("Illegal session name length of 0 received");
+ goto error;
}
if (header.hostname_len > LTTNG_HOST_NAME_MAX) {
ret = -ENAMETOOLONG;
ERR("Length of hostname (%" PRIu32 " bytes) received in create_session command exceeds maximum length (%d bytes)", header.hostname_len, LTTNG_HOST_NAME_MAX);
goto error;
}
}
if (header.hostname_len > LTTNG_HOST_NAME_MAX) {
ret = -ENAMETOOLONG;
ERR("Length of hostname (%" PRIu32 " bytes) received in create_session command exceeds maximum length (%d bytes)", header.hostname_len, LTTNG_HOST_NAME_MAX);
goto error;
}
+ if (header.base_path_len > LTTNG_PATH_MAX) {
+ ret = -ENAMETOOLONG;
+ ERR("Length of base_path (%" PRIu32 " bytes) received in create_session command exceeds maximum length (%d bytes)", header.base_path_len, PATH_MAX);