verifiers: Fix calling uninitialized function pointer
The necessary check for NULL before use of function ver->close is not taking place in the failure path. This patch simply adds the missing check and fixes the problem that GRUB hangs indefinitely after booting rogue image without valid signature if secure boot is turned on. Now it displays like this for booting rogue UEFI image: error: bad shim signature error: you need to load the kernel first Press any key to continue... and then you can go back to boot menu by pressing any key or after a few seconds expired. Signed-off-by: Michael Chang <mchang@suse.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
0ad07e928a
commit
d0de8b37f6
1 changed files with 2 additions and 1 deletions
|
@ -196,6 +196,7 @@ grub_verifiers_open (grub_file_t io, enum grub_file_type type)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
if (ver->close)
|
||||||
ver->close (context);
|
ver->close (context);
|
||||||
fail_noclose:
|
fail_noclose:
|
||||||
verified_free (verified);
|
verified_free (verified);
|
||||||
|
|
Loading…
Reference in a new issue