]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelFrameworkModulePkg BdsDxe: Use safe string functions
authorHao Wu <hao.a.wu@intel.com>
Tue, 30 Jun 2015 06:26:47 +0000 (06:26 +0000)
committerhwu1225 <hwu1225@Edk2>
Tue, 30 Jun 2015 06:26:47 +0000 (06:26 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17735 6f19259b-4bc3-4df7-8a09-765794883524

IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
IntelFrameworkModulePkg/Universal/BdsDxe/MemoryTest.c

index a0c638100a6f8726ae30949260c28e22165bf7d0..5646457664b2c8d747430c9a61f18cad6007bf9c 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   FrontPage routines to handle the callbacks and browser calls\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
@@ -628,9 +628,9 @@ ConvertProcessorToString (
   StringBuffer = AllocateZeroPool (0x20);\r
   ASSERT (StringBuffer != NULL);\r
   Index = UnicodeValueToString (StringBuffer, LEFT_JUSTIFY, FreqMhz / 1000, 3);\r
-  StrCat (StringBuffer, L".");\r
+  StrCatS (StringBuffer, 0x20 / sizeof (CHAR16), L".");\r
   UnicodeValueToString (StringBuffer + Index + 1, PREFIX_ZERO, (FreqMhz % 1000) / 10, 2);\r
-  StrCat (StringBuffer, L" GHz");\r
+  StrCatS (StringBuffer, 0x20 / sizeof (CHAR16), L" GHz");\r
   *String = (CHAR16 *) StringBuffer;\r
   return ;\r
 }\r
@@ -654,7 +654,7 @@ ConvertMemorySizeToString (
   StringBuffer = AllocateZeroPool (0x20);\r
   ASSERT (StringBuffer != NULL);\r
   UnicodeValueToString (StringBuffer, LEFT_JUSTIFY, MemorySize, 6);\r
-  StrCat (StringBuffer, L" MB RAM");\r
+  StrCatS (StringBuffer, 0x20 / sizeof (CHAR16), L" MB RAM");\r
 \r
   *String = (CHAR16 *) StringBuffer;\r
 \r
index 5a6fa78553280b50ad621273c852915de379b46c..eef840b8826f86067ac2fbc86f980d00786811ff 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Perform the platform memory test\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
@@ -324,7 +324,7 @@ BdsMemoryTest (
           //\r
           // TmpStr size is 64, StrPercent is reserved to 16.\r
           //\r
-          StrnCat (StrPercent, TmpStr, sizeof (StrPercent) / sizeof (CHAR16) - StrLen (StrPercent) - 1);\r
+          StrCatS (StrPercent, sizeof (StrPercent) / sizeof (CHAR16), TmpStr);\r
           PrintXY (10, 10, NULL, NULL, StrPercent);\r
           FreePool (TmpStr);\r
         }\r
@@ -389,7 +389,7 @@ Done:
 \r
     TmpStr = GetStringById (STRING_TOKEN (STR_MEM_TEST_COMPLETED));\r
     if (TmpStr != NULL) {\r
-      StrnCat (StrTotalMemory, TmpStr, StrTotalMemorySize / sizeof (CHAR16) - StrLen (StrTotalMemory) - 1);\r
+      StrCatS (StrTotalMemory, StrTotalMemorySize / sizeof (CHAR16), TmpStr);\r
       FreePool (TmpStr);\r
     }\r
 \r