Skip to content

Commit

Permalink
Merge pull request #64104 from ClickHouse/backport/23.8/64024
Browse files Browse the repository at this point in the history
Backport #64024 to 23.8: Deserialize untrusted binary inputs in a safer way
  • Loading branch information
rschu1ze committed May 19, 2024
2 parents 65d4535 + f555fbf commit f4f08fe
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 @@ -134,7 +135,7 @@ inline Field getBinaryValue(UInt8 type, ReadBuffer & buf)
return bool(value);
}
}
return Field();
throw Exception(ErrorCodes::INCORRECT_DATA, "Unknown field type {}", std::to_string(type));
}

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

0 comments on commit f4f08fe

Please sign in to comment.