mirror of
https://github.com/nivekuil/rip
synced 2024-11-26 05:30:18 +00:00
Fix use after free due to insufficient lifetime
This commit is contained in:
parent
a5f730bc38
commit
100bbc8bc9
1 changed files with 2 additions and 4 deletions
|
@ -219,12 +219,10 @@ fn copy_file(source: &Path, dest: &Path) -> io::Result<()> {
|
|||
return Err(e);
|
||||
}
|
||||
} else if filetype.is_fifo() {
|
||||
let path = std::ffi::CString::new(dest.to_str().unwrap())
|
||||
.unwrap()
|
||||
.as_ptr();
|
||||
let path = std::ffi::CString::new(dest.to_str().unwrap()).unwrap();
|
||||
let mode = metadata.permissions().mode();
|
||||
unsafe {
|
||||
libc::mkfifo(path, mode);
|
||||
libc::mkfifo(path.as_ptr(), mode);
|
||||
}
|
||||
} else if filetype.is_symlink() {
|
||||
let target = try!(fs::read_link(source));
|
||||
|
|
Loading…
Reference in a new issue