pykeio / ort

Fast ML inference & training for Rust with ONNX Runtime
https://ort.pyke.io/
Apache License 2.0
859 stars 100 forks source link

Invalid string pointers in `OpenVINOExecutionProvider` #250

Closed spencercw closed 2 months ago

spencercw commented 2 months ago

OpenVINOExecutionProvider::register does not correctly handle string options. The strings are cloned and then passed to map_or_else which extracts the pointer, but the cloned strings are dropped at the end of the lambda, resulting in invalid pointers. Moreover, the strings are not NULL terminated. This results in errors such as You have selcted wrong configuration value for the key 'device_type' if these options are used.

spencercw commented 2 months ago

Crikey, that was a quick turnaround. Nevertheless, the strings are still not null-terminated.