summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/C
diff options
context:
space:
mode:
authorJiang, Xiaolu <Xiaolu.Jiang@intel.com>2021-11-29 10:13:03 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-12-09 00:43:16 +0000
commit7b2831000894f3091cac633e61d9bcf3661cc44b (patch)
treeea5fbe55ef07c3379374e1028fa10fdd17791b4f /BaseTools/Source/C
parent85a678bf76c5aac2e40255f48ea3209ff95f150a (diff)
downloadedk2-7b2831000894f3091cac633e61d9bcf3661cc44b.tar.gz
edk2-7b2831000894f3091cac633e61d9bcf3661cc44b.tar.bz2
edk2-7b2831000894f3091cac633e61d9bcf3661cc44b.zip
BaseTools: Increase the DevicePath length for support more PCD value.
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>
Diffstat (limited to 'BaseTools/Source/C')
-rw-r--r--BaseTools/Source/C/DevicePath/DevicePath.c2
1 files changed, 1 insertions, 1 deletions
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");
return STATUS_ERROR;
}
- Str16 = (CHAR16 *)malloc(1024);
+ Str16 = (CHAR16 *)malloc((strlen (Str) + 1) * sizeof (CHAR16));
if (Str16 == NULL) {
fprintf(stderr, "Resource, memory cannot be allocated");
return STATUS_ERROR;