Skip to content

Commit 474849c

Browse files
committed
efi/device_path: Use from_ne_bytes
Signed-off-by: Akira Moroo <[email protected]>
1 parent 9a3ca5f commit 474849c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/efi/device_path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl DevicePath {
5353
error!("Unexpected end of device path");
5454
return DevicePath::Unsupported;
5555
}
56-
let len = unsafe { core::mem::transmute::<[u8; 2], u16>(dpp.length) };
56+
let len = u16::from_ne_bytes(dpp.length);
5757
dpp = unsafe { &*((dpp as *const _ as u64 + len as u64) as *const _) };
5858
}
5959
}

0 commit comments

Comments
 (0)