diff --git a/src/arch/x86_64/firecracker.rs b/src/arch/x86_64/firecracker.rs index 6110d314..f0f8af07 100644 --- a/src/arch/x86_64/firecracker.rs +++ b/src/arch/x86_64/firecracker.rs @@ -144,7 +144,13 @@ 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 };