SHA256
1
0
forked from pool/efibootmgr
efibootmgr/efibootmgr-check-boot-order.diff

19 lines
640 B
Diff
Raw Normal View History

---
src/efibootmgr/efibootmgr.c | 3 +++
1 file changed, 3 insertions(+)
Index: efibootmgr-0.12/src/efibootmgr/efibootmgr.c
===================================================================
--- efibootmgr-0.12.orig/src/efibootmgr/efibootmgr.c
+++ efibootmgr-0.12/src/efibootmgr/efibootmgr.c
@@ -451,6 +451,9 @@ remove_dupes_from_boot_order(void)
/* Adjust the size if we didn't copy everything. */
new_data_size = sizeof(new_data[0]) * new_i;
+ if (new_i == 0)
+ return efi_del_variable(EFI_GLOBAL_GUID, "BootOrder");
+
/* Now new_data has what we need */
free(boot_order->data);
boot_order->data = (uint8_t *)new_data;