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

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

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

Modified: head/stand/efi/libefi/efinet.c
==============================================================================
--- head/stand/efi/libefi/efinet.c      Thu Feb 20 07:12:43 2020        
(r358156)
+++ head/stand/efi/libefi/efinet.c      Thu Feb 20 08:48:34 2020        
(r358157)
@@ -371,6 +371,8 @@ efinet_dev_init()
        status = BS->LocateHandle(ByProtocol, &sn_guid, NULL, &sz, NULL);
        if (status == EFI_BUFFER_TOO_SMALL) {
                handles = (EFI_HANDLE *)malloc(sz);
+               if (handles == NULL)
+                       return (ENOMEM);
                status = BS->LocateHandle(ByProtocol, &sn_guid, NULL, &sz,
                    handles);
                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