From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=68.232.149.214; helo=esa4.dell-outbound.iphmx.com; envelope-from=jim.dailey@dell.com; receiver=edk2-devel@lists.01.org Received: from esa4.dell-outbound.iphmx.com (esa4.dell-outbound.iphmx.com [68.232.149.214]) (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 C4B8821197B16 for ; Fri, 30 Nov 2018 07:43:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1543592612; x=1575128612; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=eU6Ld5xLdARnSkD/bLQbzRAgntFLoPdTlYDTMh1Czgs=; b=PX8NVYwDH1qKKemggsd0gClFy+/PG1AMAJiHlwmm+Txv/1Scu1R3MWed 07+DIdvHfqWcIUvgOkmtyGYUP2OZJFHRSn7q7/X0QHBhcrZ4DorLRalFa tPd77Qx/F99i3s3okRr+RYYsJvgydoza7kycVFJC3KbX1/3ZQ19DhspsM c=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EDAAD7WQFchyeV50NjGgEBAQEBAgE?= =?us-ascii?q?BAQEHAgEBAQGBUQUBAQEBCwGCaYECJwqMB1+LKYINki8ghHqBegsBARgLC4Q?= =?us-ascii?q?+AoM1IjQJDQEDAQECAQECAQECEAEBAQoLCQgpIwyCNiISgQsBAQEBAQEBAQF?= =?us-ascii?q?NAg1jAQEBAQMBARAoNAsMBAIBCBEEAQEfCQcnAR4JCAEBBAENBQgagn8BggE?= =?us-ascii?q?Pmg09AoEQiVgBAQGCHYopBYIuiWyCFoNuNYMeAQSBJ4YSAokplwwHAoZ/hhu?= =?us-ascii?q?EFSCRH4h7hGSKVwIEAgQFAhSBRoIOcFCCbII1iGeFP0ABMQGMAoEugR8BAQ?= X-IPAS-Result: =?us-ascii?q?A2EDAAD7WQFchyeV50NjGgEBAQEBAgEBAQEHAgEBAQGBU?= =?us-ascii?q?QUBAQEBCwGCaYECJwqMB1+LKYINki8ghHqBegsBARgLC4Q+AoM1IjQJDQEDA?= =?us-ascii?q?QECAQECAQECEAEBAQoLCQgpIwyCNiISgQsBAQEBAQEBAQFNAg1jAQEBAQMBA?= =?us-ascii?q?RAoNAsMBAIBCBEEAQEfCQcnAR4JCAEBBAENBQgagn8BggEPmg09AoEQiVgBA?= =?us-ascii?q?QGCHYopBYIuiWyCFoNuNYMeAQSBJ4YSAokplwwHAoZ/hhuEFSCRH4h7hGSKV?= =?us-ascii?q?wIEAgQFAhSBRoIOcFCCbII1iGeFP0ABMQGMAoEugR8BAQ?= Received: from mx0a-00154901.pphosted.com ([67.231.149.39]) by esa4.dell-outbound.iphmx.com with ESMTP/TLS/AES256-SHA256; 30 Nov 2018 09:43:31 -0600 Received: from pps.filterd (m0142699.ppops.net [127.0.0.1]) by mx0a-00154901.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wAUGb3iO010984 for ; Fri, 30 Nov 2018 11:37:39 -0500 Received: from esa5.dell-outbound2.iphmx.com (esa5.dell-outbound2.iphmx.com [68.232.153.203]) by mx0a-00154901.pphosted.com with ESMTP id 2p38gk056g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 30 Nov 2018 11:37:39 -0500 From: Received: from ausc60pc101.us.dell.com ([143.166.85.206]) by esa5.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA256; 30 Nov 2018 21:43:25 +0600 X-LoopCount0: from 10.166.136.210 X-IronPort-AV: E=Sophos;i="5.56,299,1539666000"; d="scan'208";a="1331801309" To: , CC: Thread-Topic: [PATCH] MdePkg-BaseLib: PathCleanUpDirectories fix Thread-Index: AdSIvm+Qf7WXTWr+SCODCcTYAgn9iAAAVWcw Date: Fri, 30 Nov 2018 15:43:18 +0000 Message-ID: <7a2851948cc24393879f9aa7318bffc6@ausx13mps335.AMER.DELL.COM> References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Enabled=True; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_SiteId=945c199a-83a2-4e80-9f8c-5a91be5752dd; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Owner=Jim_Dailey@Dell.com; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_SetDate=2018-11-30T15:03:58.7478991Z; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Name=External Public; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Application=Microsoft Azure Information Protection; MSIP_Label_17cb76b2-10b8-4fe1-93d4-2202842406cd_Extended_MSFT_Method=Manual; Sensitivity=External Public x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.143.242.75] MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-11-30_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811300134 Subject: Re: [PATCH] MdePkg-BaseLib: PathCleanUpDirectories fix 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: Fri, 30 Nov 2018 15:43:33 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Oops! I think this change may have an issue. Hold off and I'll let you know if that's the case. --Jim -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Dail= ey, Jim Sent: Friday, November 30, 2018 9:12 AM To: liming.gao@intel.com; michael.d.kinney@intel.com Cc: edk2-devel@lists.01.org Subject: [edk2] [PATCH] MdePkg-BaseLib: PathCleanUpDirectories fix PathCleanUpDirectories does not handle "\..\" properly; it returns "\" instead of "". This change fixes that problem so that "" is returned. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jim Dailey --- MdePkg/Library/BaseLib/FilePaths.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MdePkg/Library/BaseLib/FilePaths.c b/MdePkg/Library/BaseLib/Fi= lePaths.c index 92e4c350ff..69e46dd135 100644 --- a/MdePkg/Library/BaseLib/FilePaths.c +++ b/MdePkg/Library/BaseLib/FilePaths.c @@ -110,7 +110,12 @@ PathCleanUpDirectories( ((*(TempString + 3) =3D=3D L'\\') || (*(TempString + 3) =3D=3D CH= AR_NULL)) ) { *(TempString + 1) =3D CHAR_NULL; - PathRemoveLastItem(Path); + if (!PathRemoveLastItem(Path)) { + // + // We had "\.." + // + *Path =3D CHAR_NULL; + } if (*(TempString + 3) !=3D CHAR_NULL) { CopyMem (Path + StrLen (Path), TempString + 4, StrSize (TempString += 4)); } --=20 2.17.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel