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
This commit is contained in:
parent
a6f9024f20
commit
981887b970
@ -139,6 +139,8 @@ utf8_to_ucs2(const char *name, efi_char **nmp, size_t *len)
|
||||
sz = strlen(name) * 2 + 2;
|
||||
if (*nmp == NULL)
|
||||
*nmp = malloc(sz);
|
||||
if (*nmp == NULL)
|
||||
return (ENOMEM);
|
||||
nm = *nmp;
|
||||
*len = sz;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user