Skip to content

Commit

Permalink
Backport #64024 to 23.8: Deserialize untrusted binary inputs in a saf…
Browse files Browse the repository at this point in the history
…er way
  • Loading branch information
robot-clickhouse committed May 19, 2024
1 parent 65d4535 commit f555fbf
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 f555fbf

Please sign in to comment.