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>
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