Skip to content

Commit

Permalink
Merge pull request #404 from hermit-os/firecracker-null
Browse files Browse the repository at this point in the history
fix(firecracker): remove trailing null from bootargs
  • Loading branch information
mkroening authored Nov 16, 2024
2 parents 37661bf + 51e6aee commit 36499f2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/arch/x86_64/firecracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,16 @@ pub unsafe fn boot_kernel(kernel_info: LoadedKernel) -> ! {
)
};

Some(core::str::from_utf8(slice).unwrap())
let s = core::str::from_utf8(slice)
.unwrap()
.strip_suffix('\0')
.unwrap();

if s.is_empty() {
None
} else {
Some(s)
}
} else {
None
};
Expand Down

0 comments on commit 36499f2

Please sign in to comment.