Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vulkan: Don't use pointer to dropped PhysicalDeviceDriverProperties.
Detected by ASAN, but seems impossible to exploit. Since `ash::vk::definitions::PhysicalDeviceDriverProperties` is `Copy`, the statement if let Some(driver) = phd_capabilities.driver { ... } actually makes `driver` a local copy of the struct. The code uses `as_ptr` to create a pointer to the `driver_name` field of this local copy, and then tries to use that pointer outside the `if let`, when the local copy has gone out of scope. This is UB. Taking a reference to the properties struct is correct and more efficient.
- Loading branch information