arrfab / rpms / shim

Forked from rpms/shim 4 years ago
Clone

Blame SOURCES/0046-unhook_system_services-bail-on-systab-NULL.patch

e97c83
From 77cdb40423e29a5f9d1318cd0ada874ee1916450 Mon Sep 17 00:00:00 2001
e97c83
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
e97c83
Date: Tue, 12 Aug 2014 15:33:19 +0200
e97c83
Subject: [PATCH 46/74] unhook_system_services: bail on systab == NULL
e97c83
e97c83
Prevent unhook_system_services() from dereferencing a NULL systab, which
e97c83
may occur if hook_system_services() has never been called.
e97c83
e97c83
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
e97c83
---
e97c83
 replacements.c | 3 +++
e97c83
 1 file changed, 3 insertions(+)
e97c83
e97c83
diff --git a/replacements.c b/replacements.c
e97c83
index 48dc437..5dfa355 100644
e97c83
--- a/replacements.c
e97c83
+++ b/replacements.c
e97c83
@@ -70,6 +70,9 @@ static EFI_HANDLE last_loaded_image;
e97c83
 void
e97c83
 unhook_system_services(void)
e97c83
 {
e97c83
+	if (!systab)
e97c83
+		return;
e97c83
+
e97c83
 	systab->BootServices->Exit = system_exit;
e97c83
 	systab->BootServices->LoadImage = system_load_image;
e97c83
 	systab->BootServices->StartImage = system_start_image;
e97c83
-- 
e97c83
1.9.3
e97c83