Functions `ScanInferenceFunction()`, `ScanInferenceFunction opset8()`, and `ScanInferenceFunction opset9()` fail to safely validate the `num scan inputs` attribute. A missing attribute leads to a null pointer dereference, while a negative value is converted to `size t`, potentially triggering an oversized allocation path. This allows an untrusted model to disrupt or terminate shape inference, even if the model passes `onnx.checker.check model()`.