From: "Gao, Liming" <liming.gao@intel.com>
To: "Ni, Ruiyu" <ruiyu.ni@intel.com>,
"Jim.Dailey@dell.com" <Jim.Dailey@dell.com>,
"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [PATCH] MdePkg-BaseLib: Fix PathCleanUpDirectories() issue with "\\..\\.."
Date: Wed, 24 Oct 2018 04:44:57 +0000 [thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E35B214@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5BED03FC@SHSMSX104.ccr.corp.intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
>-----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 <michael.d.kinney@intel.com>; Gao, Liming
><liming.gao@intel.com>
>Subject: RE: [edk2] [PATCH] MdePkg-BaseLib: Fix PathCleanUpDirectories()
>issue with "\\..\\.."
>
>Reviewed-by: Ruiyu Ni <Ruiyu.ni@Intel.com>
>
>Thanks/Ray
>
>> -----Original Message-----
>> From: edk2-devel <edk2-devel-bounces@lists.01.org> 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 <michael.d.kinney@intel.com>; Gao, Liming
>> <liming.gao@intel.com>
>> 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 <jim_dailey@dell.com>
>> ---
>> 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.<BR>
>> + Copyright (c) 2018, Dell Technologies. All rights reserved.<BR>
>> 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 may be
>> found at @@ -85,6 +86,13 @@ PathCleanUpDirectories(
>> }
>> }
>>
>> + //
>> + // Replace the "\\" with "\"
>> + //
>> + while ((TempString = StrStr (Path, L"\\\\")) != 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 = StrStr (Path, L"\\\\")) != 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
prev parent reply other threads:[~2018-10-24 4:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-05 19:14 [PATCH] MdePkg-BaseLib: Fix PathCleanUpDirectories() issue with "\\..\\.." Jim.Dailey
2018-10-24 4:42 ` Ni, Ruiyu
2018-10-24 4:44 ` Gao, Liming [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E35B214@SHSMSX104.ccr.corp.intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox