Skip to content

Commit

Permalink
Merge pull request #64105 from ClickHouse/backport/24.2/64024
Browse files Browse the repository at this point in the history
Backport #64024 to 24.2: Deserialize untrusted binary inputs in a safer way
  • Loading branch information
rschu1ze committed May 19, 2024
2 parents 66cc391 + 1d02ac2 commit 854d635
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Core/Field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace ErrorCodes
{
extern const int CANNOT_RESTORE_FROM_FIELD_DUMP;
extern const int DECIMAL_OVERFLOW;
extern const int INCORRECT_DATA;
}

inline Field getBinaryValue(UInt8 type, ReadBuffer & buf)
Expand Down Expand Up @@ -140,7 +141,7 @@ inline Field getBinaryValue(UInt8 type, ReadBuffer & buf)
case Field::Types::CustomType:
return Field();
}
UNREACHABLE();
throw Exception(ErrorCodes::INCORRECT_DATA, "Unknown field type {}", std::to_string(type));
}

void readBinary(Array & x, ReadBuffer & buf)
Expand Down

0 comments on commit 854d635

Please sign in to comment.