]> git.proxmox.com Git - efi-boot-shim.git/commitdiff
unhook_system_services: bail on systab == NULL
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 12 Aug 2014 13:33:19 +0000 (15:33 +0200)
committerPeter Jones <pjones@redhat.com>
Tue, 12 Aug 2014 14:54:05 +0000 (10:54 -0400)
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>
replacements.c

index 48dc43785e2d6a5c3684e1ee78870db10634efd0..5dfa3556718453b18b505d0c156c7b35626a2cde 100644 (file)
@@ -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;