onnxruntime
613bc03d - Reject nodes that feed inputs to a zero-input operator schema (#32633)

Commit
53 days ago
Reject nodes that feed inputs to a zero-input operator schema (#32633) ### Description <!-- Describe your changes. --> Add an explicit validation in `Node::UpdateInputArgCount()` to reject a node that supplies actual inputs while its bound operator/function schema declares no formal input parameters. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> When `op.inputs()` is empty but the node has ≥1 input, the arg-count adjustment loop was skipped yet the trailing `input_arg_count.push_back(arg_count_left)` still ran unconditionally, producing `InputArgCount().size() == 1` against `op.inputs().size() == 0`. This size-invariant violation later caused an out-of-bounds read at `op.inputs()[i]` in `InferAndVerifyTypeMatch` during `Graph::Resolve()`. This is reachable only via a model-local function in a custom domain: for registered ops, `OpSchema::Verify` in the ONNX checker rejects the extra inputs first, but for custom-domain function calls the checker performs no arity validation.
Author
Parents
Loading