From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=68.232.153.95; helo=esa5.dell-outbound.iphmx.com; envelope-from=jim.dailey@dell.com; receiver=edk2-devel@lists.01.org Received: from esa5.dell-outbound.iphmx.com (esa5.dell-outbound.iphmx.com [68.232.153.95]) (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 66E5921197B0B for ; Fri, 30 Nov 2018 07:11:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=dell.com; i=@dell.com; q=dns/txt; s=smtpout; t=1543590695; x=1575126695; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=9bGQvPM/StsydSaGR9ZtsVqki6j2KPfr8kXvjHS7ssU=; b=ck4SUbDiAxERy+LfXeFmYCbYLQOue8v41MLRXfKWSKKO23MDGb2fwbGj Qr9ohYFWDA8VsQc8hnrcLFoCP/+O8fWsA8rfDEeq39D6Hg664E3On60M2 zZFUFwfF6M/PCv9KchZWQMR2c7tIy+Vd+qhLHTJKESZ1QvhARAVzgo2rU I=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2EgAAChUQFchyWd50NjHAEBAQQBAQc?= =?us-ascii?q?EAQGBUQcBAQsBg2snCowHX4sphAqQMiCEeoF6CwEBhGyDNyI0CQ0BAwEBAgE?= =?us-ascii?q?BAgEBAhABAQEKCwkIKS+CNiKCaBYoPxIBPmgBBAENBQgagn+CApoUPQKBEIl?= =?us-ascii?q?YAQEBgh2KLIIuiWyCFoNuhH+GEgKJKZcMBwKRLyCRHgGIe487AgQCBAUCFIF?= =?us-ascii?q?Ggg5wgzyCNY4mQAExjAOBLoEfAQE?= X-IPAS-Result: =?us-ascii?q?A2EgAAChUQFchyWd50NjHAEBAQQBAQcEAQGBUQcBAQsBg?= =?us-ascii?q?2snCowHX4sphAqQMiCEeoF6CwEBhGyDNyI0CQ0BAwEBAgEBAgEBAhABAQEKC?= =?us-ascii?q?wkIKS+CNiKCaBYoPxIBPmgBBAENBQgagn+CApoUPQKBEIlYAQEBgh2KLIIui?= =?us-ascii?q?WyCFoNuhH+GEgKJKZcMBwKRLyCRHgGIe487AgQCBAUCFIFGgg5wgzyCNY4mQ?= =?us-ascii?q?AExjAOBLoEfAQE?= Received: from mx0b-00154901.pphosted.com ([67.231.157.37]) by esa5.dell-outbound.iphmx.com with ESMTP/TLS/AES256-SHA256; 30 Nov 2018 09:11:33 -0600 Received: from pps.filterd (m0144102.ppops.net [127.0.0.1]) by mx0b-00154901.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wAUF800M175423 for ; Fri, 30 Nov 2018 10:11:37 -0500 Received: from esa3.dell-outbound2.iphmx.com (esa3.dell-outbound2.iphmx.com [68.232.154.63]) by mx0b-00154901.pphosted.com with ESMTP id 2p30prjakk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 30 Nov 2018 10:11:37 -0500 From: Received: from ausxipps301.us.dell.com ([143.166.148.223]) by esa3.dell-outbound2.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA256; 30 Nov 2018 21:11:32 +0600 X-LoopCount0: from 10.166.136.216 X-IronPort-AV: E=Sophos;i="5.56,299,1539666000"; d="scan'208";a="269834309" To: , CC: Thread-Topic: [PATCH] MdePkg-BaseLib: PathCleanUpDirectories fix Thread-Index: AdSIvm+Qf7WXTWr+SCODCcTYAgn9iA== Date: Fri, 30 Nov 2018 15:11:35 +0000 Message-ID: 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=459 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1811300129 Subject: [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:11:40 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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