diff options
author | Jiang, Xiaolu <Xiaolu.Jiang@intel.com> | 2021-11-29 10:13:03 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-09 00:43:16 +0000 |
commit | 7b2831000894f3091cac633e61d9bcf3661cc44b (patch) | |
tree | ea5fbe55ef07c3379374e1028fa10fdd17791b4f /BaseTools/Source/C | |
parent | 85a678bf76c5aac2e40255f48ea3209ff95f150a (diff) | |
download | edk2-7b2831000894f3091cac633e61d9bcf3661cc44b.zip edk2-7b2831000894f3091cac633e61d9bcf3661cc44b.tar.gz edk2-7b2831000894f3091cac633e61d9bcf3661cc44b.tar.bz2 |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
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;
|