mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
Merge pull request #24922 from Avogar/fix-arrow
Fix possible heap-buffer-overflow in Arrow
This commit is contained in:
commit
3b0757bb52
@ -90,9 +90,12 @@ namespace DB
|
|||||||
arrow::BinaryArray & chunk = static_cast<arrow::BinaryArray &>(*(arrow_column->chunk(chunk_i)));
|
arrow::BinaryArray & chunk = static_cast<arrow::BinaryArray &>(*(arrow_column->chunk(chunk_i)));
|
||||||
const size_t chunk_length = chunk.length();
|
const size_t chunk_length = chunk.length();
|
||||||
|
|
||||||
|
if (chunk_length > 0)
|
||||||
|
{
|
||||||
chars_t_size += chunk.value_offset(chunk_length - 1) + chunk.value_length(chunk_length - 1);
|
chars_t_size += chunk.value_offset(chunk_length - 1) + chunk.value_length(chunk_length - 1);
|
||||||
chars_t_size += chunk_length; /// additional space for null bytes
|
chars_t_size += chunk_length; /// additional space for null bytes
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
column_chars_t.reserve(chars_t_size);
|
column_chars_t.reserve(chars_t_size);
|
||||||
column_offsets.reserve(arrow_column->length());
|
column_offsets.reserve(arrow_column->length());
|
||||||
|
Loading…
Reference in New Issue
Block a user