From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web09.55868.1638151998640317905 for ; Sun, 28 Nov 2021 18:13:19 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: xiaolu.jiang@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10182"; a="236115639" X-IronPort-AV: E=Sophos;i="5.87,272,1631602800"; d="scan'208";a="236115639" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Nov 2021 18:13:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,272,1631602800"; d="scan'208";a="511480707" Received: from xiaolu-dev.ccr.corp.intel.com ([10.239.158.148]) by orsmga008.jf.intel.com with ESMTP; 28 Nov 2021 18:13:15 -0800 From: "Xiaolu.Jiang" To: devel@edk2.groups.io Cc: "Xiaolu.Jiang" , Bob Feng , Liming Gao , Yuwei Chen Subject: [edk2-devel][PATCH] BaseTools: Increase the DevicePath length for support more PCD value. Date: Mon, 29 Nov 2021 10:13:03 +0800 Message-Id: <20211129021303.2199-1-xiaolu.jiang@intel.com> X-Mailer: git-send-email 2.30.2.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Currently the PCD Value only support 13 Guid,When use more 13 pcd will caus= e the build tool fail, Need calculate the required memory,then allocate it. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3718 Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Xiaolu Jiang --- BaseTools/Source/C/DevicePath/DevicePath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Source/C/DevicePath/DevicePath.c b/BaseTools/Source/= C/DevicePath/DevicePath.c index c4d224ed61..ed19eb52f6 100644 --- a/BaseTools/Source/C/DevicePath/DevicePath.c +++ b/BaseTools/Source/C/DevicePath/DevicePath.c @@ -170,7 +170,7 @@ int main(int argc, CHAR8 *argv[]) fprintf(stderr, "Invalid option value, Device Path can't be NULL");=0D return STATUS_ERROR;=0D }=0D - Str16 =3D (CHAR16 *)malloc(1024);=0D + Str16 =3D (CHAR16 *)malloc((strlen (Str) + 1) * sizeof (CHAR16));=0D if (Str16 =3D=3D NULL) {=0D fprintf(stderr, "Resource, memory cannot be allocated");=0D return STATUS_ERROR;=0D --=20 2.30.2.windows.1