Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jan 2018 20:35:54 +0000 (UTC)
From:      Toomas Soome <tsoome@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328061 - head/stand/efi/libefi
Message-ID:  <201801162035.w0GKZsaV056975@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801162035.w0GKZsaV056975>