]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/DevicePath/DevicePath.c
BaseTools: Increase the DevicePath length for support more PCD value.
[mirror_edk2.git] / BaseTools / Source / C / DevicePath / DevicePath.c
index c4d224ed619e6d5694a32941c2231553d437d11c..ed19eb52f6a924484dec1d0fd17e2130bb4714c3 100644 (file)
@@ -170,7 +170,7 @@ int main(int argc, CHAR8 *argv[])
     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