Files
RedBear-OS/virtio-core
bjorn3 9bb1222933 Fix UB lint in virtio-core
error: casting references to a bigger memory layout than the backing allocation is undefined behavior, even if the reference is unused
   --> virtio-core/src/probe.rs:126:21
    |
86  |         let capability = unsafe { &*(capability.data.as_ptr() as *const PciCapability) };
    |                                    --------------------------------------------------- backing allocation comes from here
...
126 |                     (&*(capability as *const PciCapability as *const PciCapabilityNotify))
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: casting from `transport_pci::PciCapability` (13 bytes) to `transport_pci::PciCapabilityNotify` (17 bytes)
    = note: `#[deny(invalid_reference_casting)]` on by default
2024-03-06 21:06:26 +01:00
..
2024-03-06 21:06:26 +01:00
2023-09-07 20:49:37 -06:00