Skip to content

Commit

Permalink
fix(uhyve): fix improper unlink string handling
Browse files Browse the repository at this point in the history
  • Loading branch information
n0toose committed Dec 9, 2024
1 parent fcb871c commit b0afe95
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/fs/uhyve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,16 @@ impl VfsNode for UhyveDirectory {

fn traverse_unlink(&self, components: &mut Vec<&str>) -> io::Result<()> {
let path: String = if components.is_empty() {
"/".to_string()
"/\0".to_string()
} else {
components
let mut path: String = components
.iter()
.rev()
.map(|v| "/".to_owned() + v)
.collect()
.collect();
path.push('\0');
path.remove(0);
path
};

let mut sysunlink = SysUnlink::new(VirtAddr::from_ptr(path.as_ptr()));
Expand Down

0 comments on commit b0afe95

Please sign in to comment.