From 7b2831000894f3091cac633e61d9bcf3661cc44b Mon Sep 17 00:00:00 2001 From: "Jiang, Xiaolu" Date: Mon, 29 Nov 2021 10:13:03 +0800 Subject: 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 Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Xiaolu Jiang Reviewed-by: Liming Gao Reviewed-by: Bob Feng --- BaseTools/Source/C/DevicePath/DevicePath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BaseTools') diff --git a/BaseTools/Source/C/DevicePath/DevicePath.c b/BaseTools/Source/C/DevicePath/DevicePath.c index c4d224e..ed19eb5 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; -- cgit v1.1