From nobody Fri Dec 27 02:12:36 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1501573930827769.1257886788683; Tue, 1 Aug 2017 00:52:10 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1289121D0FDEF; Tue, 1 Aug 2017 00:50:00 -0700 (PDT) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 877E221D091B9 for ; Tue, 1 Aug 2017 00:49:58 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP; 01 Aug 2017 00:52:07 -0700 Received: from shwdeopenpsi114.ccr.corp.intel.com ([10.239.157.135]) by orsmga001.jf.intel.com with ESMTP; 01 Aug 2017 00:52:04 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,305,1498546800"; d="scan'208";a="1157610481" From: Dandan Bi To: edk2-devel@lists.01.org Date: Tue, 1 Aug 2017 15:51:29 +0800 Message-Id: <1501573889-162300-1-git-send-email-dandan.bi@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 Subject: [edk2] [patch] BaseTools/VfrCompile: Remove the MAX_PATH limitation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Daniel=20D=EDaz?= , Eric Dong , Liming Gao Content-Type: multipart/mixed; boundary="===============6113723725078852755==" Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 --===============6113723725078852755== Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D579 Since we have already used LongFilePath() to convert file path, so we can remove the MAX_PATH limitation. Cc: Eric Dong Cc: Liming Gao Cc: Daniel D=EF=BF=BDaz Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Eric Dong --- BaseTools/Source/C/VfrCompile/EfiVfr.h | 3 +-- BaseTools/Source/C/VfrCompile/VfrCompiler.cpp | 24 ------------------------ 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/BaseTools/Source/C/VfrCompile/EfiVfr.h b/BaseTools/Source/C/Vf= rCompile/EfiVfr.h index d187902..10d1257 100644 --- a/BaseTools/Source/C/VfrCompile/EfiVfr.h +++ b/BaseTools/Source/C/VfrCompile/EfiVfr.h @@ -1,9 +1,9 @@ /** @file Defines and prototypes for the UEFI VFR compiler internal use. =20 -Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials =20 are licensed and made available under the terms and conditions of the BSD = License =20 which accompanies this distribution. The full text of the license may be = found at =20 http://opensource.org/licenses/bsd-license.php = =20 = =20 @@ -17,11 +17,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITH= ER EXPRESS OR IMPLIED. =20 #include "Common/UefiBaseTypes.h" #include "Common/UefiInternalFormRepresentation.h" #include "Common/MdeModuleHii.h" =20 -#define MAX_PATH 255 #define MAX_VFR_LINE_LEN 4096 =20 #define EFI_IFR_MAX_LENGTH 0xFF #define MAX_IFR_EXPRESSION_DEPTH 0x9 =20 diff --git a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp b/BaseTools/Sour= ce/C/VfrCompile/VfrCompiler.cpp index e65a925..831f6b5 100644 --- a/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp +++ b/BaseTools/Source/C/VfrCompile/VfrCompiler.cpp @@ -117,14 +117,10 @@ CVfrCompiler::OptionInitialization ( Index++; if ((Index >=3D Argc) || (Argv[Index][0] =3D=3D '-')) { DebugError (NULL, 0, 1001, "Missing option", "-o missing output di= rectory name"); goto Fail; } - if (strlen (Argv[Index]) > MAX_PATH - 1) { - DebugError (NULL, 0, 1003, "Invalid option value", "Output directo= ry name %s is too long", Argv[Index]); - goto Fail; - } =20 mOptions.OutputDirectory =3D (CHAR8 *) malloc (strlen (Argv[Index]) = + strlen ("\\") + 1); if (mOptions.OutputDirectory =3D=3D NULL) { DebugError (NULL, 0, 4001, "Resource: memory can't be allocated", = NULL); goto Fail; @@ -184,14 +180,10 @@ CVfrCompiler::OptionInitialization ( =20 if (Index !=3D Argc - 1) { DebugError (NULL, 0, 1001, "Missing option", "VFR file name is not spe= cified."); goto Fail; } else { - if (strlen (Argv[Index]) > MAX_PATH) { - DebugError (NULL, 0, 1003, "Invalid option value", "VFR file name %s= is too long.", Argv[Index]); - goto Fail; - } mOptions.VfrFileName =3D (CHAR8 *) malloc (strlen (Argv[Index]) + 1); if (mOptions.VfrFileName =3D=3D NULL) { DebugError (NULL, 0, 4001, "Resource: memory can't be allocated", NU= LL); goto Fail; } @@ -353,14 +345,10 @@ CVfrCompiler::SetBaseFileName ( if ((pExt =3D strchr (pFileName, '.')) =3D=3D NULL) { return -1; } =20 *pExt =3D '\0'; - if (strlen (pFileName) > MAX_PATH - 1) { - *pExt =3D '.'; - return -1; - } =20 mOptions.VfrBaseFileName =3D (CHAR8 *) malloc (strlen (pFileName) + 1); if (mOptions.VfrBaseFileName =3D=3D NULL) { *pExt =3D '.'; return -1; @@ -385,13 +373,10 @@ CVfrCompiler::SetPkgOutputFileName ( =20 Length =3D strlen (mOptions.OutputDirectory) + strlen (mOptions.VfrBaseFileName) + strlen (VFR_PACKAGE_FILENAME_EXTENSION) + 1; - if (Length > MAX_PATH) { - return -1; - } =20 mOptions.PkgOutputFileName =3D (CHAR8 *) malloc (Length); if (mOptions.PkgOutputFileName =3D=3D NULL) { return -1; } @@ -416,13 +401,10 @@ CVfrCompiler::SetCOutputFileName ( =20 Length =3D strlen (mOptions.OutputDirectory) + strlen (mOptions.VfrBaseFileName) + strlen (".c") + 1; - if (Length > MAX_PATH) { - return -1; - } =20 mOptions.COutputFileName =3D (CHAR8 *) malloc (Length); if (mOptions.COutputFileName =3D=3D NULL) { return -1; } @@ -447,13 +429,10 @@ CVfrCompiler::SetPreprocessorOutputFileName ( =20 Length =3D strlen (mOptions.OutputDirectory) + strlen (mOptions.VfrBaseFileName) + strlen (VFR_PREPROCESS_FILENAME_EXTENSION) + 1; - if (Length > MAX_PATH) { - return -1; - } =20 mOptions.PreprocessorOutputFileName =3D (CHAR8 *) malloc (Length); if (mOptions.PreprocessorOutputFileName =3D=3D NULL) { return -1; } @@ -478,13 +457,10 @@ CVfrCompiler::SetRecordListFileName ( =20 Length =3D strlen (mOptions.OutputDirectory) + strlen (mOptions.VfrBaseFileName) + strlen (VFR_RECORDLIST_FILENAME_EXTENSION) + 1; - if (Length > MAX_PATH) { - return -1; - } =20 mOptions.RecordListFile =3D (CHAR8 *) malloc (Length); if (mOptions.RecordListFile =3D=3D NULL) { return -1; } --=20 1.9.5.msysgit.1 --===============6113723725078852755== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel --===============6113723725078852755==--