summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2014-08-12 10:54:05 -0400
committerPeter Jones <pjones@redhat.com>2014-08-12 10:54:05 -0400
commit277127d1b34778076c07556b11c6cbf917bf6252 (patch)
tree764c39a0e7035be4881c275b3b95c5e4544632d1
parent4dabdb22b4d72ac21e9817c3d60711dc03f58059 (diff)
downloadefi-boot-shim-277127d1b34778076c07556b11c6cbf917bf6252.tar.gz
efi-boot-shim-277127d1b34778076c07556b11c6cbf917bf6252.zip
unhook_system_services: bail on systab == NULL
Prevent unhook_system_services() from dereferencing a NULL systab, which may occur if hook_system_services() has never been called. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
-rw-r--r--replacements.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/replacements.c b/replacements.c
index 48dc4378..5dfa3556 100644
--- a/replacements.c
+++ b/replacements.c
@@ -70,6 +70,9 @@ static EFI_HANDLE last_loaded_image;
void
unhook_system_services(void)
{
+ if (!systab)
+ return;
+
systab->BootServices->Exit = system_exit;
systab->BootServices->LoadImage = system_load_image;
systab->BootServices->StartImage = system_start_image;