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

Toomas Soome tsoome at FreeBSD.org
Thu Feb 20 09:03:00 UTC 2020


Author: tsoome
Date: Thu Feb 20 09:02:59 2020
New Revision: 358163
URL: https://svnweb.freebsd.org/changeset/base/358163

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

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

Modified: head/stand/efi/libefi/handles.c
==============================================================================
--- head/stand/efi/libefi/handles.c	Thu Feb 20 09:00:20 2020	(r358162)
+++ head/stand/efi/libefi/handles.c	Thu Feb 20 09:02:59 2020	(r358163)
@@ -52,6 +52,8 @@ efi_register_handles(struct devsw *sw, EFI_HANDLE *han
 	nentries += count;
 	sz = nentries * sizeof(struct entry);
 	entry = (entry == NULL) ? malloc(sz) : realloc(entry, sz);
+	if (entry == NULL)
+		return (ENOMEM);
 	for (unit = 0; idx < nentries; idx++, unit++) {
 		entry[idx].handle = handles[unit];
 		if (aliases != NULL)


More information about the svn-src-all mailing list