From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 98AEC817CC for ; Sun, 8 Jan 2017 18:18:47 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 08 Jan 2017 18:18:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,339,1477983600"; d="scan'208";a="211071863" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga004.fm.intel.com with ESMTP; 08 Jan 2017 18:18:47 -0800 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 8 Jan 2017 18:18:47 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 8 Jan 2017 18:18:47 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.204]) with mapi id 14.03.0248.002; Mon, 9 Jan 2017 10:18:43 +0800 From: "Gao, Liming" To: "Wu, Hao A" , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" Thread-Topic: [PATCH] MdePkg/UefiFileHandleLib: Refine the check for valid Ascii character Thread-Index: AQHSZ/nioU2IpHvUc0SpJCCylro69qEvbWtw Date: Mon, 9 Jan 2017 02:18:41 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14D6CAB60@shsmsx102.ccr.corp.intel.com> References: <1483692589-31920-1-git-send-email-hao.a.wu@intel.com> In-Reply-To: <1483692589-31920-1-git-send-email-hao.a.wu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdePkg/UefiFileHandleLib: Refine the check for valid Ascii character X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jan 2017 02:18:47 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Wu, Hao A >Sent: Friday, January 06, 2017 4:50 PM >To: edk2-devel@lists.01.org >Cc: Wu, Hao A ; Gao, Liming ; >Kinney, Michael D >Subject: [PATCH] MdePkg/UefiFileHandleLib: Refine the check for valid Asci= i >character > >The commit will check if bit 7 is set of an Ascii character to judge its >validity. > >Cc: Liming Gao >Cc: Michael Kinney >Contributed-under: TianoCore Contribution Agreement 1.0 >Signed-off-by: Hao Wu >--- > MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c >b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c >index daed0f4..57aad77 100644 >--- a/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c >+++ b/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.c >@@ -1,7 +1,7 @@ > /** @file > Provides interface to EFI_FILE_HANDLE functionality. > >- Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
>+ Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the B= SD >License > which accompanies this distribution. The full text of the license may = be >found at >@@ -1138,7 +1138,7 @@ FileHandleWriteLine( > } > UnicodeStrToAsciiStrS (Buffer, AsciiBuffer, Size); > for (Index =3D 0; Index < Size; Index++) { >- if (!((AsciiBuffer[Index] >=3D 0) && (AsciiBuffer[Index] < 128))){ >+ if ((AsciiBuffer[Index] & BIT7) !=3D 0) { > FreePool(AsciiBuffer); > return EFI_INVALID_PARAMETER; > } >-- >1.9.5.msysgit.0