You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The signature of CString::new is CString::new(buf: *const i8, owns_buffer: bool). The problem with this is that if the new CString does own the buffer it's going to free it. In which case buf should be a *mut i8 not a *const i8. However making buf: *mut i8 doesn't account for the case where the CString doesn't own the buffer and the buffer is immutable.
To fix this CString::new should be split into two functions: