mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-08 05:17:31 +00:00
trivial: uefi: Only set EFI variables on real systems
Avoids copying from a NULL pointer. Caught via clang static analysis
This commit is contained in:
parent
981ee65554
commit
6ed307c5fb
@ -339,16 +339,16 @@ fu_uefi_device_write_firmware (FuDevice *device, GBytes *fw, GError **error)
|
|||||||
fu_uefi_prefix_efi_errors (error);
|
fu_uefi_prefix_efi_errors (error);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* save this header and body to the hardware */
|
/* save this header and body to the hardware */
|
||||||
datasz = sizeof(info) + dp_bufsz;
|
datasz = sizeof(info) + dp_bufsz;
|
||||||
data = g_malloc0 (datasz);
|
data = g_malloc0 (datasz);
|
||||||
memcpy (data, &info, sizeof(info));
|
memcpy (data, &info, sizeof(info));
|
||||||
memcpy (data + sizeof(info), dp_buf, dp_bufsz);
|
memcpy (data + sizeof(info), dp_buf, dp_bufsz);
|
||||||
if (!fu_uefi_device_set_efivar (self, data, datasz, error)) {
|
if (!fu_uefi_device_set_efivar (self, data, datasz, error)) {
|
||||||
fu_uefi_prefix_efi_errors (error);
|
fu_uefi_prefix_efi_errors (error);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update the firmware before the bootloader runs */
|
/* update the firmware before the bootloader runs */
|
||||||
|
Loading…
Reference in New Issue
Block a user