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)
_______________________________________________
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