diff --git a/src/arch/x86_64/firecracker.rs b/src/arch/x86_64/firecracker.rs index 6110d31..85490e9 100644 --- a/src/arch/x86_64/firecracker.rs +++ b/src/arch/x86_64/firecracker.rs @@ -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 };