Skip to content

Commit ab3fea9

Browse files
authored
Fix vulnerabilities in yql_plan.cpp reported by coverity (#9306)
1 parent e7ab6ea commit ab3fea9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ydb/library/yql/core/services/yql_plan.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ void WriteProviders(const TString& tag, const TProviderInfoMap& providers, NYson
127127
writer.OnListItem();
128128
writer.OnBeginMap();
129129
writer.OnKeyedItem("Id");
130-
writer.OnUint64Scalar(p.second.Pin.find(pin)->second);
130+
const auto found = p.second.Pin.find(pin);
131+
YQL_ENSURE(found != p.second.Pin.cend());
132+
writer.OnUint64Scalar(found->second);
131133
p.second.Provider->GetPlanFormatter().WritePinDetails(*pin, writer);
132134
writer.OnEndMap();
133135
}
@@ -412,7 +414,9 @@ class TPlanBuilder : public IPlanBuilder {
412414
THashMap<TPinKey, ui32, TPinKey::THash> allInputs;
413415
THashMap<TPinKey, ui32, TPinKey::THash> allOutputs;
414416
for (auto node : order) {
415-
auto& info = nodes.find(node.Get())->second;
417+
const auto found = nodes.find(node.Get());
418+
YQL_ENSURE(found != nodes.cend());
419+
auto& info = found->second;
416420
if (!info.IsVisible) {
417421
continue;
418422
}

0 commit comments

Comments
 (0)