summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbabenko <[email protected]>2024-10-23 23:53:12 +0300
committerbabenko <[email protected]>2024-10-24 00:06:30 +0300
commitd49138967e72fb02c1e3dc716588aefb9762f1dc (patch)
tree815539d0f5f7ea5861e356e2e53594a42466acf1
parentdf8fd26e1b47be057e75f75661a62469b8707954 (diff)
YT-22885: Fix crash on malicious schema (temporary workaround)
commit_hash:a19b7682787d3e0326d31f336ac853ce50de1ff8
-rw-r--r--yt/yt/client/table_client/logical_type.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/yt/yt/client/table_client/logical_type.cpp b/yt/yt/client/table_client/logical_type.cpp
index ef61f7f0c7c..2fe14d9870e 100644
--- a/yt/yt/client/table_client/logical_type.cpp
+++ b/yt/yt/client/table_client/logical_type.cpp
@@ -2054,12 +2054,20 @@ public:
const TLogicalTypePtr& GetSimpleType(ESimpleLogicalValueType type)
{
- return GetOrCrash(SimpleTypeMap_, type);
+ auto it = SimpleTypeMap_.find(type);
+ if (it == SimpleTypeMap_.end()) {
+ THROW_ERROR_EXCEPTION("Unknown type %Qlv", type);
+ }
+ return it->second;
}
const TLogicalTypePtr& GetOptionalType(ESimpleLogicalValueType type)
{
- return GetOrCrash(OptionalTypeMap_, type);
+ auto it = OptionalTypeMap_.find(type);
+ if (it == OptionalTypeMap_.end()) {
+ THROW_ERROR_EXCEPTION("Unknown type %Qlv", type);
+ }
+ return it->second;
}
private: