mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-02 14:50:49 +00:00
Use the correct range check when parsing SMBIOS
The SMBIOS specification says: Maximum size of SMBIOS Structure Table, pointed to by the Structure Table Address, in bytes. The actual size is guaranteed to be less or equal to the maximum size. So, the firmware is actually allowed to return a DMI blob smaller than the specified size. Fixes https://github.com/fwupd/fwupd/issues/5486
This commit is contained in:
parent
e3c660d203
commit
a9dbbc99f7
@ -325,7 +325,7 @@ fu_smbios_setup_from_path(FuSmbios *self, const gchar *path, GError **error)
|
||||
dmi_fn = g_build_filename(path, "DMI", NULL);
|
||||
if (!g_file_get_contents(dmi_fn, &dmi_raw, &sz, error))
|
||||
return FALSE;
|
||||
if (sz != self->structure_table_len) {
|
||||
if (sz > self->structure_table_len) {
|
||||
g_set_error(error,
|
||||
FWUPD_ERROR,
|
||||
FWUPD_ERROR_INVALID_FILE,
|
||||
|
Loading…
Reference in New Issue
Block a user