Open
Description
Hi, I've noticed three dangling pointer issues in the below functions, which could lead to use-after-free bugs.
Lines 89 to 96 in 7ba975c
Lines 108 to 115 in 7ba975c
Lines 118 to 125 in 7ba975c
All three functions are due to a same line of code: let fname = CString::new(file).unwrap().as_ptr();
.
Suggested fix:
put the above code in the same statement of the FFI call, like ffi::linenoiseHistorySave(CString::new(file).unwrap().as_ptr());
Metadata
Metadata
Assignees
Labels
No labels