svn commit: r328061 - head/stand/efi/libefi
Toomas Soome
tsoome at FreeBSD.org
Tue Jan 16 20:35:56 UTC 2018
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;
More information about the svn-src-head
mailing list