Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cast data_index as size_t in cuda_row_data to avoid integer overflow #5706

Merged
merged 1 commit into from
Feb 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/io/cuda/cuda_row_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ void CUDARowData::GetDenseDataPartitioned(const BIN_TYPE* row_wise_data, std::ve
const int partition_column_end = feature_partition_column_index_offsets_[i + 1];
const int num_columns_in_cur_partition = partition_column_end - partition_column_start;
for (data_size_t data_index = start; data_index < end; ++data_index) {
const size_t data_offset = offset + data_index * num_columns_in_cur_partition;
const size_t data_offset = offset + static_cast<size_t>(data_index) * num_columns_in_cur_partition;
const size_t read_data_offset = static_cast<size_t>(data_index) * num_total_columns;
for (int column_index = 0; column_index < num_columns_in_cur_partition; ++column_index) {
const size_t true_column_index = read_data_offset + column_index + partition_column_start;
Expand Down