]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/FirmwareVolume/UpdateDriverDxe/ParseUpdateProfile.c
IntelFrameworkModulePkg UpdateDriverDxe: Use safe string functions
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / FirmwareVolume / UpdateDriverDxe / ParseUpdateProfile.c
index 17e728db30f501e7473db8f8655e3563c4c10562..023506e6eeffc1197f3dac113c7345d1b3b7a3a2 100644 (file)
@@ -3,7 +3,7 @@
   configuration file and pass the information to the update driver\r
   so that the driver can perform updates accordingly.\r
 \r
-  Copyright (c) 2002 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2002 - 2015, Intel Corporation. All rights reserved.<BR>\r
 \r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions\r
@@ -674,11 +674,10 @@ UpdateStringToGuid (
   UINT8                                 Digits[3];\r
 \r
   StrLen          = AsciiStrLen  ((CONST CHAR8 *) Str);\r
-  Buffer          = AllocatePool (StrLen + 1);\r
+  Buffer          = AllocateCopyPool (StrLen + 1, Str);\r
   if (Buffer == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
-  AsciiStrCpy ((CHAR8 *)Buffer, (CHAR8 *)Str);\r
 \r
   //\r
   // Data1\r
@@ -997,7 +996,7 @@ ParseUpdateDataFile (
     //\r
     // Get the section name of each update\r
     //\r
-    AsciiStrCpy (Entry, "Update");\r
+    AsciiStrCpyS (Entry, MAX_LINE_LENGTH, "Update");\r
     UpdateStrCatNumber ((UINT8 *) Entry, Index);\r
     Value               = NULL;\r
     Status              = UpdateGetProfileString (\r