diff options
author | Roman Udovichenko <rvu@ydb.tech> | 2024-04-22 19:03:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-22 19:03:31 +0300 |
commit | c05d352c297779ce0993d3675c1e84dc704f4a5e (patch) | |
tree | 98983e8c7f4ef327b57a3509df7688ac37c4ddbd | |
parent | 7a7798a387fe7f43cf4d64bd050dae9f298a9d59 (diff) | |
download | ydb-c05d352c297779ce0993d3675c1e84dc704f4a5e.tar.gz |
Fix possible nullptr deref (#4000)
-rw-r--r-- | ydb/library/yql/providers/yt/gateway/native/yql_yt_lambda_builder.cpp | 6 | ||||
-rw-r--r-- | ydb/library/yql/providers/yt/provider/yql_yt_join_impl.cpp | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/ydb/library/yql/providers/yt/gateway/native/yql_yt_lambda_builder.cpp b/ydb/library/yql/providers/yt/gateway/native/yql_yt_lambda_builder.cpp index 1ca94b87a9..8f2e9db2dc 100644 --- a/ydb/library/yql/providers/yt/gateway/native/yql_yt_lambda_builder.cpp +++ b/ydb/library/yql/providers/yt/gateway/native/yql_yt_lambda_builder.cpp @@ -56,8 +56,10 @@ NKikimr::NMiniKQL::TComputationNodeFactory GetGatewayNodeFactory(TCodecContext* if (files) { if (callable.GetType()->GetName() == "FilePathJob" || callable.GetType()->GetName() == "FileContentJob") { const TString fullFileName(AS_VALUE(TDataLiteral, callable.GetInput(0))->AsValue().AsStringRef()); - auto path = files->GetFile(fullFileName)->Path->GetPath(); - auto content = callable.GetType()->GetName() == "FileContentJob" ? TFileInput(path).ReadAll() : path.GetPath(); + const auto fileInfo = files->GetFile(fullFileName); + YQL_ENSURE(fileInfo, "Unknown file path " << fullFileName); + const auto path = fileInfo->Path->GetPath(); + const auto content = callable.GetType()->GetName() == "FileContentJob" ? TFileInput(path).ReadAll() : path.GetPath(); return ctx.NodeFactory.CreateImmutableNode(MakeString(content)); } } diff --git a/ydb/library/yql/providers/yt/provider/yql_yt_join_impl.cpp b/ydb/library/yql/providers/yt/provider/yql_yt_join_impl.cpp index 3b029d7fda..4e1e204644 100644 --- a/ydb/library/yql/providers/yt/provider/yql_yt_join_impl.cpp +++ b/ydb/library/yql/providers/yt/provider/yql_yt_join_impl.cpp @@ -3775,6 +3775,7 @@ void CollectPossibleStarJoins(const TYtEquiJoin& equiJoin, TYtJoinNodeOp& op, co if (leftLeaf && rightLeaf) { YQL_ENSURE(leftLeaf->Label->Content() != rightLeaf->Label->Content()); + YQL_ENSURE(leftItemType && rightItemType); auto inputKeyTypeLeft = BuildJoinKeyType(*leftItemType, leftJoinKeyList); auto inputKeyTypeRight = BuildJoinKeyType(*rightItemType, rightJoinKeyList); if (!IsSameAnnotation(*AsDictKeyType(RemoveNullsFromJoinKeyType(inputKeyTypeLeft), ctx), |