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))
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to