efibootmgr/efibootmgr-0.6.0-check-boot-order.diff

15 lines
433 B
Diff

diff --git a/src/efibootmgr/efibootmgr.c b/src/efibootmgr/efibootmgr.c
index 7ea1887..b01a05a 100644
--- a/src/efibootmgr/efibootmgr.c
+++ b/src/efibootmgr/efibootmgr.c
@@ -380,6 +380,9 @@ remove_from_boot_order(uint16_t num)
}
}
+ if (new_i == 0)
+ return delete_variable(&boot_order);
+
/* Now new_data has what we need */
new_data_size = new_i * sizeof(uint16_t);
memset(&(boot_order.Data), 0, boot_order.DataSize);