svn commit: r328030 - head/stand/efi/boot1

Warner Losh imp at FreeBSD.org
Mon Jan 15 22:17:36 UTC 2018


Author: imp
Date: Mon Jan 15 22:17:34 2018
New Revision: 328030
URL: https://svnweb.freebsd.org/changeset/base/328030

Log:
  Check the return value from utf8_to_ucs2 instead of whether or not uv
  is NULL. That's more correct and doesn't depend on the error behavior
  of utf8_to_ucs2. In practice, we'll never see this though since we
  pass utf8_to_ucs2 a well formed string.
  
  Sponsored by: Netflix
  Differential Revision: https://reviews.freebsd.org/D13918

Modified:
  head/stand/efi/boot1/boot1.c

Modified: head/stand/efi/boot1/boot1.c
==============================================================================
--- head/stand/efi/boot1/boot1.c	Mon Jan 15 22:17:15 2018	(r328029)
+++ head/stand/efi/boot1/boot1.c	Mon Jan 15 22:17:34 2018	(r328030)
@@ -106,8 +106,7 @@ efi_setenv_freebsd_wcs(const char *varname, CHAR16 *va
 	size_t len;
 	EFI_STATUS rv;
 
-	utf8_to_ucs2(varname, &var, &len);
-	if (var == NULL)
+	if (utf8_to_ucs2(varname, &var, &len) != 0)
 		return (EFI_OUT_OF_RESOURCES);
 	rv = RS->SetVariable(var, &FreeBSDBootVarGUID,
 	    EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,


More information about the svn-src-all mailing list