From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 6596B81AD5 for ; Mon, 9 Jan 2017 07:42:45 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 09 Jan 2017 07:42:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,340,1477983600"; d="scan'208";a="28060385" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga002.jf.intel.com with ESMTP; 09 Jan 2017 07:42:24 -0800 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.47]) by FMSMSX105.amr.corp.intel.com ([169.254.4.250]) with mapi id 14.03.0248.002; Mon, 9 Jan 2017 07:42:23 -0800 From: "Carsey, Jaben" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: "Ni, Ruiyu" , "Carsey, Jaben" Thread-Topic: [Patch] Nt32Pkg/WinNtSimpleFileSystemDxe: Fix ASSERT() parsing '\' Thread-Index: AQHSaRr3M0+HrbGa/UG0bcPdl8LxiqEwS7aA Date: Mon, 9 Jan 2017 15:42:23 +0000 Message-ID: References: <1483816764-9164-1-git-send-email-michael.d.kinney@intel.com> In-Reply-To: <1483816764-9164-1-git-send-email-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.1.200.106] 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: Mon, 09 Jan 2017 15:42:45 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jaben Carsey > -----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 >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D331 >=20 > If Nt32 is built using UEFI Shell from the ShellPkg sources, an ASSERT() = is > generated when a single '\' character is entered at the shell prompt. >=20 > 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. >=20 > 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(+) >=20 > 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; > + } > } >=20 > return Token; > -- > 2.6.3.windows.1