diff options
| -rw-r--r-- | lib/efi_loader/efi_capsule.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index 52887f7c274..a77810fa15c 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -860,7 +860,11 @@ static efi_status_t get_dp_device(u16 *boot_var, if (!buf) return EFI_NOT_FOUND; - efi_deserialize_load_option(&lo, buf, &size); + ret = efi_deserialize_load_option(&lo, buf, &size); + if (ret != EFI_SUCCESS) { + log_err("Invalid load option %ls\n", boot_var); + goto out; + } if (lo.attributes & LOAD_OPTION_ACTIVE) { efi_dp_split_file_path(lo.file_path, device_dp, &file_dp); @@ -871,6 +875,7 @@ static efi_status_t get_dp_device(u16 *boot_var, ret = EFI_NOT_FOUND; } +out: free(buf); return ret; |
