svn commit: r358159 - head/stand/efi/libefi

Toomas Soome tsoome at FreeBSD.org
Thu Feb 20 08:55:19 UTC 2020


Author: tsoome
Date: Thu Feb 20 08:55:18 2020
New Revision: 358159
URL: https://svnweb.freebsd.org/changeset/base/358159

Log:
  connect_controllers() is missing NULL pointer check
  
  Add missing check of malloc() result.

Modified:
  head/stand/efi/libefi/efi_driver_utils.c

Modified: head/stand/efi/libefi/efi_driver_utils.c
==============================================================================
--- head/stand/efi/libefi/efi_driver_utils.c	Thu Feb 20 08:53:04 2020	(r358158)
+++ head/stand/efi/libefi/efi_driver_utils.c	Thu Feb 20 08:55:18 2020	(r358159)
@@ -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,


More information about the svn-src-all mailing list