Avoid unaligned access in the XsdtIter
The pointers in the XSDT table are only 4 byte aligned.
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ impl Iterator for XsdtIter {
|
||||
type Item = usize;
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
if self.i < self.sdt.data_len() / mem::size_of::<u64>() {
|
||||
let item = unsafe { *(self.sdt.data_address() as *const u64).add(self.i) };
|
||||
let item = unsafe { core::ptr::read_unaligned((self.sdt.data_address() as *const u64).add(self.i)) };
|
||||
self.i += 1;
|
||||
Some(item as usize)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user