mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
Merge pull request #22099 from ClickHouse/map-populate-series-ubsan
Fix UBSan report in mapPopulateSeries.
This commit is contained in:
commit
cb6926629e
@ -190,7 +190,7 @@ private:
|
||||
}
|
||||
|
||||
static constexpr size_t MAX_ARRAY_SIZE = 1ULL << 30;
|
||||
if (static_cast<size_t>(max_key - min_key) > MAX_ARRAY_SIZE)
|
||||
if (static_cast<size_t>(max_key) - static_cast<size_t>(min_key) > MAX_ARRAY_SIZE)
|
||||
throw Exception(ErrorCodes::TOO_LARGE_ARRAY_SIZE, "Too large array size in the result of function {}", getName());
|
||||
|
||||
/* fill the result arrays */
|
||||
|
@ -0,0 +1,2 @@
|
||||
-- Should correctly throw exception about overflow:
|
||||
SELECT mapPopulateSeries([-9223372036854775808, toUInt32(2)], [toUInt32(1023), -1]); -- { serverError 128 }
|
Loading…
Reference in New Issue
Block a user