From 277127d1b34778076c07556b11c6cbf917bf6252 Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Tue, 12 Aug 2014 10:54:05 -0400 Subject: 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 --- replacements.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'replacements.c') 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; -- cgit v1.2.3