From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 EB07481B07 for ; Mon, 9 Jan 2017 17:55:12 -0800 (PST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP; 09 Jan 2017 17:55:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,341,1477983600"; d="scan'208";a="1092010572" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 09 Jan 2017 17:55:12 -0800 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 9 Jan 2017 17:55:12 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 9 Jan 2017 17:55:12 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.59]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.132]) with mapi id 14.03.0248.002; Tue, 10 Jan 2017 09:55:09 +0800 From: "Ni, Ruiyu" To: "Carsey, Jaben" , "Kinney, Michael D" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] Nt32Pkg/WinNtSimpleFileSystemDxe: Fix ASSERT() parsing '\' Thread-Index: AQHSaRr4fRQ6m1s5iEW34PJ4tThu6aEvxZ6AgAExLgA= Date: Tue, 10 Jan 2017 01:55:09 +0000 Deferred-Delivery: Tue, 10 Jan 2017 01:55:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5B879945@SHSMSX104.ccr.corp.intel.com> References: <1483816764-9164-1-git-send-email-michael.d.kinney@intel.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] Nt32Pkg/WinNtSimpleFileSystemDxe: Fix ASSERT() parsing '\' 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: Tue, 10 Jan 2017 01:55:13 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ruiyu Ni Thanks/Ray > -----Original Message----- > From: Carsey, Jaben > Sent: Monday, January 9, 2017 11:42 PM > To: Kinney, Michael D ; edk2- > devel@lists.01.org > Cc: Ni, Ruiyu ; Carsey, Jaben > Subject: RE: [Patch] Nt32Pkg/WinNtSimpleFileSystemDxe: Fix ASSERT() > parsing '\' >=20 > Reviewed-by: Jaben Carsey >=20 > > -----Original Message----- > > From: Kinney, Michael D > > Sent: Saturday, January 7, 2017 11:19 AM > > To: edk2-devel@lists.01.org > > Cc: Ni, Ruiyu ; Carsey, Jaben > > ; Kinney, Michael D > > > > Subject: [Patch] Nt32Pkg/WinNtSimpleFileSystemDxe: Fix ASSERT() parsing > '\' > > Importance: High > > > > https://bugzilla.tianocore.org/show_bug.cgi?id=3D331 > > > > If Nt32 is built using UEFI Shell from the ShellPkg sources, an > > ASSERT() is generated when a single '\' character is entered at the she= ll > prompt. > > > > The WinNtSimpleFileSystemDxe module GetNextFileNameToken() > function > > breaks a file path up into tokens, but it does not handle the case > > where a FileName ends in a '\' character. > > It returns an empty string instead of NULL. The fix is to set > > *FileName to NULL if the remaining file path is an empty string. > > > > Cc: Ruiyu Ni > > Cc: Jaben Carsey > > Contributed-under: TianoCore Contribution Agreement 1.0 > > Signed-off-by: Michael D Kinney > > --- > > Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c | 6 > ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c > > b/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c > > index 6cff2df..5bb5832 100644 > > --- a/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c > > +++ b/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c > > @@ -748,6 +748,12 @@ GetNextFileNameToken ( > > // Point *FileName to the next character after L'\'. > > // > > *FileName =3D *FileName + Offset + 1; > > + // > > + // If *FileName is an empty string, then set *FileName to NULL > > + // > > + if (**FileName =3D=3D L'\0') { > > + *FileName =3D NULL; > > + } > > } > > > > return Token; > > -- > > 2.6.3.windows.1