mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-07 17:15:29 +00:00
Fix possible null pointer dereference. (#10373)
NodeInfo::p_node was used directly but it can be null from here:
2afce4830c/onnxruntime/core/framework/session_state_utils.cc (L381-L382)
Add an additional check that it is not null before use.
This commit is contained in:
parent
e1012a8662
commit
5eafbb50f9
1 changed files with 1 additions and 1 deletions
|
|
@ -52,7 +52,7 @@ static common::Status SyncProviders(const SessionState::NameNodeInfoMapType& nod
|
|||
std::set<std::string> providers;
|
||||
for (auto& pair : node_info_map) {
|
||||
for (auto& node_info : pair.second) {
|
||||
if (node_info.p_node->GetExecutionProviderType() != onnxruntime::kCpuExecutionProvider) {
|
||||
if (node_info.p_node && node_info.p_node->GetExecutionProviderType() != onnxruntime::kCpuExecutionProvider) {
|
||||
providers.insert(node_info.p_node->GetExecutionProviderType());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue