From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.20; helo=mga02.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org 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 869472117AE77 for ; Tue, 23 Oct 2018 21:45:08 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Oct 2018 21:45:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,418,1534834800"; d="scan'208";a="100169317" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 23 Oct 2018 21:45:08 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 23 Oct 2018 21:45:07 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 23 Oct 2018 21:45:07 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.117]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.214]) with mapi id 14.03.0415.000; Wed, 24 Oct 2018 12:44:57 +0800 From: "Gao, Liming" To: "Ni, Ruiyu" , "Jim.Dailey@dell.com" , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" Thread-Topic: [edk2] [PATCH] MdePkg-BaseLib: Fix PathCleanUpDirectories() issue with "\\..\\.." Thread-Index: AdRcxfJOhj5wPON1SDO1wGMOnK85sAOjjeQwAAABSCA= Date: Wed, 24 Oct 2018 04:44:57 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E35B214@SHSMSX104.ccr.corp.intel.com> References: <87e40160c8f14bc7991ea0a7406c7d1c@ausx13mps339.AMER.DELL.COM> <734D49CCEBEEF84792F5B80ED585239D5BED03FC@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5BED03FC@SHSMSX104.ccr.corp.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-BaseLib: Fix PathCleanUpDirectories() issue with "\\..\\.." X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2018 04:45:08 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao >-----Original Message----- >From: Ni, Ruiyu >Sent: Wednesday, October 24, 2018 12:43 PM >To: Jim.Dailey@dell.com; edk2-devel@lists.01.org >Cc: Kinney, Michael D ; Gao, Liming > >Subject: RE: [edk2] [PATCH] MdePkg-BaseLib: Fix PathCleanUpDirectories() >issue with "\\..\\.." > >Reviewed-by: Ruiyu Ni > >Thanks/Ray > >> -----Original Message----- >> From: edk2-devel On Behalf Of >> Jim.Dailey@dell.com >> Sent: Saturday, October 6, 2018 3:15 AM >> To: edk2-devel@lists.01.org >> Cc: Kinney, Michael D ; Gao, Liming >> >> Subject: [edk2] [PATCH] MdePkg-BaseLib: Fix PathCleanUpDirectories() >issue >> with "\\..\\.." >> >> Replace multiple, consecutive "\" characters prior to other processing >> involving "\" characters. This fixes an issue where "\\..\\..", "//..//= ..", and >> similar input paths are not cleaned properly. >> >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Jim Dailey >> --- >> MdePkg/Library/BaseLib/FilePaths.c | 15 ++++++++------- >> 1 file changed, 8 insertions(+), 7 deletions(-) >> >> diff --git a/MdePkg/Library/BaseLib/FilePaths.c >> b/MdePkg/Library/BaseLib/FilePaths.c >> index d6f3758ecb..c5ca0a3b77 100644 >> --- a/MdePkg/Library/BaseLib/FilePaths.c >> +++ b/MdePkg/Library/BaseLib/FilePaths.c >> @@ -2,6 +2,7 @@ >> Defines file-path manipulation functions. >> >> Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved. >> + Copyright (c) 2018, Dell Technologies. All rights reserved.
>> This program and the accompanying materials >> are licensed and made available under the terms and conditions of the= BSD >> License >> which accompanies this distribution. The full text of the license ma= y be >> found at @@ -85,6 +86,13 @@ PathCleanUpDirectories( >> } >> } >> >> + // >> + // Replace the "\\" with "\" >> + // >> + while ((TempString =3D StrStr (Path, L"\\\\")) !=3D NULL) { >> + CopyMem (TempString, TempString + 1, StrSize (TempString + 1)); } >> + >> // >> // Remove all the "\.". E.g.: fs0:\abc\.\def\. >> // >> @@ -106,13 +114,6 @@ PathCleanUpDirectories( >> CopyMem (Path + StrLen (Path), TempString + 3, StrSize (TempString = + 3)); >> } >> >> - // >> - // Replace the "\\" with "\" >> - // >> - while ((TempString =3D StrStr (Path, L"\\\\")) !=3D NULL) { >> - CopyMem (TempString, TempString + 1, StrSize (TempString + 1)); >> - } >> - >> return Path; >> } >> >> -- >> 2.17.0.windows.1 >> >> _______________________________________________ >> edk2-devel mailing list >> edk2-devel@lists.01.org >> https://lists.01.org/mailman/listinfo/edk2-devel