So we were having some issues in release builds, apparently there is an undefined behavior conversion from "main" (rust string, NOT NULL TERMINATED) to &str using CStr::from_ptr (which expects a null terminated string)
This seems to be a decent fix, although you might want to go over similar code, there might be cases I missed.
Also the error codes are slightly vague, since all these conversions just return "out of memory" even though it's not what's going on.
Thanks.
So we were having some issues in release builds, apparently there is an undefined behavior conversion from "main" (rust string, NOT NULL TERMINATED) to &str using
CStr::from_ptr
(which expects a null terminated string)This seems to be a decent fix, although you might want to go over similar code, there might be cases I missed. Also the error codes are slightly vague, since all these conversions just return "out of memory" even though it's not what's going on. Thanks.