From: Raymund Will Subject: Fix '--bootorder' handling. References: bnc#810899 Elisa Mitchell wrote: > If efibootmgr -o is called with a boot order number that does not exist > in the list you get when you execute efibootmgr, it is supposed to test > for an invalid DataSize parameter and exit. In fact, the test conducted > will never fail, even on invalid data, and the command will always take > the path to make the firmware call, passing FW an invalid DataSize value, > which can lead to panics, hangs, uninterruptible command hangs. Even if not every firmware panics over such an "invalid DataSize value", it's still a bug, which should be addressed. Reported-by: Elisa Mitchell Signed-off-by: Raymund Will --- src/efibootmgr/efibootmgr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/src/efibootmgr/efibootmgr.c +++ b/src/efibootmgr/efibootmgr.c @@ -612,10 +612,10 @@ is_current_boot_entry(int b) } -static int +static unsigned long parse_boot_order(char *buffer, uint16_t *order, int length) { - int i; + unsigned long i; int num, rc; for (i=0; i