Skip to content

Commit

Permalink
Fix vulnerabilities in yql_plan.cpp reported by coverity (#9306)
Browse files Browse the repository at this point in the history
  • Loading branch information
igormunkin authored Sep 16, 2024
1 parent e7ab6ea commit ab3fea9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ydb/library/yql/core/services/yql_plan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ void WriteProviders(const TString& tag, const TProviderInfoMap& providers, NYson
writer.OnListItem();
writer.OnBeginMap();
writer.OnKeyedItem("Id");
writer.OnUint64Scalar(p.second.Pin.find(pin)->second);
const auto found = p.second.Pin.find(pin);
YQL_ENSURE(found != p.second.Pin.cend());
writer.OnUint64Scalar(found->second);
p.second.Provider->GetPlanFormatter().WritePinDetails(*pin, writer);
writer.OnEndMap();
}
Expand Down Expand Up @@ -412,7 +414,9 @@ class TPlanBuilder : public IPlanBuilder {
THashMap<TPinKey, ui32, TPinKey::THash> allInputs;
THashMap<TPinKey, ui32, TPinKey::THash> allOutputs;
for (auto node : order) {
auto& info = nodes.find(node.Get())->second;
const auto found = nodes.find(node.Get());
YQL_ENSURE(found != nodes.cend());
auto& info = found->second;
if (!info.IsVisible) {
continue;
}
Expand Down

0 comments on commit ab3fea9

Please sign in to comment.