From ef91a071ac534ed1293f624e4e205916da8f30a4 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Thu, 20 Feb 2020 08:55:18 +0000 Subject: [PATCH] connect_controllers() is missing NULL pointer check Add missing check of malloc() result. --- stand/efi/libefi/efi_driver_utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stand/efi/libefi/efi_driver_utils.c b/stand/efi/libefi/efi_driver_utils.c index 0edea5c1e0d8..e5034c2e34d6 100644 --- a/stand/efi/libefi/efi_driver_utils.c +++ b/stand/efi/libefi/efi_driver_utils.c @@ -52,6 +52,8 @@ connect_controllers(EFI_GUID *filter) } handles = malloc(hsize); + if (handles == NULL) + return (EFI_OUT_OF_RESOURCES); nhandles = hsize / sizeof(EFI_HANDLE); status = BS->LocateHandle(ByProtocol, filter, NULL,