Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion onnxruntime/core/graph/graph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6483,7 +6483,9 @@ common::Status Graph::LoadFromOrtFormat(const onnxruntime::fbs::Graph& fbs_graph
ORT_RETURN_IF(nullptr == fbs_value_info, "NodeArg is missing. Invalid ORT format model.");
NodeArgInfo node_arg_info;
ORT_RETURN_IF_ERROR(fbs::utils::LoadValueInfoOrtFormat(*fbs_value_info, node_arg_info));
node_args_[fbs_value_info->name()->str()] = std::make_unique<NodeArg>(std::move(node_arg_info));
const auto* name = fbs_value_info->name();
ORT_RETURN_IF(name == nullptr, "NodeArg name is missing. Invalid ORT format model.");
node_args_[name->str()] = std::make_unique<NodeArg>(std::move(node_arg_info));
}
}

Expand Down
10 changes: 10 additions & 0 deletions onnxruntime/test/framework/ort_model_only_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,16 @@ TEST(OrtModelOnlyTests, GithubIssue17000) {
RunOrtModel(test_info);
}

// ICM 31000000518041.
TEST(OrtModelOnlyTests, NullNodeArgNameCheck) {
auto ort_file = ORT_TSTR("testdata/icm-31000000518041.ort");

SessionOptions so;
InferenceSessionWrapper session_object{so, GetEnvironment()};
ASSERT_STATUS_NOT_OK_AND_HAS_SUBSTR(session_object.Load(ort_file),
"NodeArg name is missing. Invalid ORT format model.");
}

#if !defined(DISABLE_ML_OPS)
// test that we can deserialize and run a previously saved ORT format model
// for a model with sequence and map outputs
Expand Down
Binary file added onnxruntime/test/testdata/icm-31000000518041.ort
Binary file not shown.
Loading