Skip to content

Commit 3c127a5

Browse files
committed
Fixed ColumnArray::Slice range check
1 parent 518b369 commit 3c127a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clickhouse/columns/array.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ ColumnRef ColumnArray::GetAsColumn(size_t n) const {
4545
}
4646

4747
ColumnRef ColumnArray::Slice(size_t begin, size_t size) const {
48-
if (size && size + begin >= Size())
48+
if (size && begin + size > Size())
4949
throw ValidationError("Slice indexes are out of bounds");
5050

5151
auto result = std::make_shared<ColumnArray>(data_->CloneEmpty(), DoNotCloneDataColumnTag{});

0 commit comments

Comments
 (0)