Skip to content

Commit

Permalink
fix wrong check for tree ensemble regressor (#21595)
Browse files Browse the repository at this point in the history
Fix missed ORT_ENFORCE check which caused heap buffer overflow because
of out of bound access.
  • Loading branch information
zhangxiang1993 authored Aug 7, 2024
1 parent 621b16f commit c93b92a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion onnxruntime/core/providers/cpu/ml/tree_ensemble_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ Status TreeEnsembleCommon<InputType, ThresholdType, OutputType>::Init(
nodes_falsenodeids.size() == nodes_values_as_tensor.size());
ORT_ENFORCE(target_class_ids.size() == target_class_nodeids.size());
ORT_ENFORCE(target_class_ids.size() == target_class_treeids.size());
ORT_ENFORCE(target_class_ids.size() == target_class_treeids.size());
ORT_ENFORCE(target_class_weights.empty() || target_class_ids.size() == target_class_weights.size());
ORT_ENFORCE(base_values.empty() || base_values_as_tensor.empty());
ORT_ENFORCE(nodes_hitrates.empty() || nodes_hitrates_as_tensor.empty());
ORT_ENFORCE(nodes_values.empty() || nodes_values_as_tensor.empty());
Expand Down

0 comments on commit c93b92a

Please sign in to comment.