Author: tsoome
Date: Tue Jan 16 20:35:54 2018
New Revision: 328061
URL: https://svnweb.freebsd.org/changeset/base/328061

Log:
  utf8_to_ucs2() should check for malloc failure
  
  utf8_to_ucs2() is calling malloc() without checking the result.
  
  Reviewed by:  imp
  Differential Revision:        https://reviews.freebsd.org/D13933

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

Modified: head/stand/efi/libefi/efichar.c
==============================================================================
--- head/stand/efi/libefi/efichar.c     Tue Jan 16 20:14:31 2018        
(r328060)
+++ head/stand/efi/libefi/efichar.c     Tue Jan 16 20:35:54 2018        
(r328061)
@@ -139,6 +139,8 @@ utf8_to_ucs2(const char *name, efi_char **nmp, size_t 
        sz = strlen(name) * 2 + 2;
        if (*nmp == NULL)
                *nmp = malloc(sz);
+       if (*nmp == NULL)
+               return (ENOMEM);
        nm = *nmp;
        *len = sz;
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to