]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Increase the DevicePath length for support more PCD value.
authorJiang, Xiaolu <Xiaolu.Jiang@intel.com>
Mon, 29 Nov 2021 02:13:03 +0000 (10:13 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 9 Dec 2021 00:43:16 +0000 (00:43 +0000)
Currently the PCD Value only support 13 Guid,When use more 13 pcd will cause the build tool fail,
Need calculate the required memory,then allocate it.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3718

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Signed-off-by: Xiaolu Jiang <xiaolu.jiang@intel.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/Source/C/DevicePath/DevicePath.c

index c4d224ed619e6d5694a32941c2231553d437d11c..ed19eb52f6a924484dec1d0fd17e2130bb4714c3 100644 (file)
@@ -170,7 +170,7 @@ int main(int argc, CHAR8 *argv[])
     fprintf(stderr, "Invalid option value, Device Path can't be NULL");\r
     return STATUS_ERROR;\r
   }\r
-  Str16 = (CHAR16 *)malloc(1024);\r
+  Str16 = (CHAR16 *)malloc((strlen (Str) + 1) * sizeof (CHAR16));\r
   if (Str16 == NULL) {\r
     fprintf(stderr, "Resource, memory cannot be allocated");\r
     return STATUS_ERROR;\r