[PATCH] BaseTools: Increase the DevicePath length for support more PCD value.


Xiaolu.Jiang
 

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 <bob.c.feng@...>
Cc: Liming Gao <gaoliming@...>
Cc: Yuwei Chen <yuwei.chen@...>

Signed-off-by: Xiaolu Jiang <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