]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/Variable.c
IntelFrameworkModulePkg BootMaint: Use safe string functions
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / BootMaint / Variable.c
index e4299ff6cb9aa3d40b253788c4bc61a9b945984b..616549e64a223f505a6de112695984680f744338 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Variable operation that will be used by bootmaint\r
 \r
-Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -579,7 +579,7 @@ Var_UpdateDriverOption (
     );\r
 \r
   if (*DescriptionData == 0x0000) {\r
-    StrCpy (DescriptionData, DriverString);\r
+    StrCpyS (DescriptionData, DESCRIPTION_DATA_SIZE, DriverString);\r
   }\r
 \r
   BufferSize = sizeof (UINT32) + sizeof (UINT16) + StrSize (DescriptionData);\r
@@ -763,7 +763,11 @@ Var_UpdateBootOption (
   UnicodeSPrint (BootString, sizeof (BootString), L"Boot%04x", Index);\r
 \r
   if (NvRamMap->BootDescriptionData[0] == 0x0000) {\r
-    StrCpy (NvRamMap->BootDescriptionData, BootString);\r
+    StrCpyS (\r
+      NvRamMap->BootDescriptionData,\r
+      sizeof (NvRamMap->BootDescriptionData) / sizeof (NvRamMap->BootDescriptionData[0]),\r
+      BootString\r
+      );\r
   }\r
 \r
   BufferSize = sizeof (UINT32) + sizeof (UINT16) + StrSize (NvRamMap->BootDescriptionData);\r