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

Toomas Soome tsoome at FreeBSD.org
Thu Feb 20 08:56:57 UTC 2020


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

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

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

Modified: head/stand/efi/libefi/efipart.c
==============================================================================
--- head/stand/efi/libefi/efipart.c	Thu Feb 20 08:55:18 2020	(r358159)
+++ head/stand/efi/libefi/efipart.c	Thu Feb 20 08:56:56 2020	(r358160)
@@ -363,6 +363,8 @@ efipart_inithandles(void)
 	status = BS->LocateHandle(ByProtocol, &blkio_guid, 0, &sz, hin);
 	if (status == EFI_BUFFER_TOO_SMALL) {
 		hin = malloc(sz);
+		if (hin == NULL)
+			return (ENOMEM);
 		status = BS->LocateHandle(ByProtocol, &blkio_guid, 0, &sz,
 		    hin);
 		if (EFI_ERROR(status))


More information about the svn-src-head mailing list