Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Oct 2021 01:16:32 GMT
From:      Kyle Evans <kevans@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 8b18746cb1bd - stable/12 - connect_controllers() is missing NULL pointer check
Message-ID:  <202110080116.1981GWwg010692@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/12 has been updated by kevans:

URL: https://cgit.FreeBSD.org/src/commit/?id=8b18746cb1bdfc89e831a023dd3dcb04c6f9e439

commit 8b18746cb1bdfc89e831a023dd3dcb04c6f9e439
Author:     Toomas Soome <tsoome@FreeBSD.org>
AuthorDate: 2020-02-20 08:55:18 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2021-10-08 01:15:58 +0000

    connect_controllers() is missing NULL pointer check
    
    Add missing check of malloc() result.
    
    (cherry picked from commit ef91a071ac534ed1293f624e4e205916da8f30a4)
---
 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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202110080116.1981GWwg010692>