mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Fixed error found by M.Filimonov (missing check for maximum size of FixedString leading to overflow in arithmetic) [#CLICKHOUSE-2].
This commit is contained in:
parent
bee53d483f
commit
09fa34c764
@ -2,6 +2,8 @@
|
||||
|
||||
#include <DataTypes/IDataType.h>
|
||||
|
||||
#define MAX_FIXEDSTRING_SIZE 0xFFFFFF
|
||||
|
||||
|
||||
namespace DB
|
||||
{
|
||||
@ -24,6 +26,8 @@ public:
|
||||
{
|
||||
if (n == 0)
|
||||
throw Exception("FixedString size must be positive", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
|
||||
if (n > MAX_FIXEDSTRING_SIZE)
|
||||
throw Exception("FixedString size is too large", ErrorCodes::ARGUMENT_OUT_OF_BOUND);
|
||||
}
|
||||
|
||||
std::string getName() const override;
|
||||
|
Loading…
Reference in New Issue
Block a user