We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df3e5a5 commit 5e4752dCopy full SHA for 5e4752d
uefi/src/table/system.rs
@@ -77,7 +77,14 @@ impl<View: SystemTableView> SystemTable<View> {
77
#[allow(clippy::missing_const_for_fn)] // Required until we bump the MSRV.
78
#[must_use]
79
pub fn config_table(&self) -> &[cfg::ConfigTableEntry] {
80
- unsafe { slice::from_raw_parts((*self.table).cfg_table, (*self.table).nr_cfg) }
+ unsafe {
81
+ let table = &*self.table;
82
+ table
83
+ .cfg_table
84
+ .as_ref()
85
+ .map(|ptr| slice::from_raw_parts(ptr, table.nr_cfg))
86
+ .unwrap_or(&[])
87
+ }
88
}
89
90
/// Creates a new `SystemTable<View>` from a raw address. The address might
0 commit comments