mirror of
https://github.com/opnsense/src.git
synced 2026-06-12 18:20:49 -04:00
efibootmgr: fix potential endless loop with -v
I observed the problem on a system with fairly old and, apparently, buggy EFI implementation. A list of boot devices had an invalid trailing entry. efidp_size() for that entry returned zero, which means that the code got stuck looping on that entry.
This commit is contained in:
parent
c053a56c0f
commit
bf87d4a4bf
1 changed files with 2 additions and 0 deletions
|
|
@ -790,6 +790,8 @@ print_loadopt_str(uint8_t *data, size_t datalen)
|
|||
*/
|
||||
indent = 1;
|
||||
while (dp < edp) {
|
||||
if (efidp_size(dp) == 0)
|
||||
break;
|
||||
efidp_format_device_path(buf, sizeof(buf), dp,
|
||||
(intptr_t)(void *)edp - (intptr_t)(void *)dp);
|
||||
printf("%*s%s\n", indent, "", buf);
|
||||
|
|
|
|||
Loading…
Reference in a new issue