Date: Mon, 15 Jan 2018 22:17:35 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328030 - head/stand/efi/boot1 Message-ID: <201801152217.w0FMHZbl093153@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801152217.w0FMHZbl093153>