Skip to content

Commit

Permalink
fix(firecracker): remove trailing null from bootargs
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening committed Nov 16, 2024
1 parent 37661bf commit 51e6aee
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 51e6aee

Please sign in to comment.