]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
IntelFrameworkModulePkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / FrontPage.c
index 6958979cdc47d50339f61d412b7c79b2e6cbe0fd..9f4d32835771b0b4c85fc043499429d561b6906e 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   FrontPage routines to handle the callbacks and browser calls\r
 \r
-Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2016, 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
@@ -300,6 +300,7 @@ InitializeFrontPage (
   EFI_STATUS                  Status;\r
   CHAR8                       *LangCode;\r
   CHAR8                       *Lang;\r
+  UINTN                       LangSize;\r
   CHAR8                       *CurrentLang;\r
   UINTN                       OptionCount;\r
   CHAR16                      *StringBuffer;\r
@@ -448,9 +449,10 @@ InitializeFrontPage (
       }\r
 \r
       if (EFI_ERROR (Status)) {\r
-        StringBuffer = AllocatePool (AsciiStrSize (Lang) * sizeof (CHAR16));\r
+        LangSize = AsciiStrSize (Lang);\r
+        StringBuffer = AllocatePool (LangSize * sizeof (CHAR16));\r
         ASSERT (StringBuffer != NULL);\r
-        AsciiStrToUnicodeStr (Lang, StringBuffer);\r
+        AsciiStrToUnicodeStrS (Lang, StringBuffer, LangSize);\r
       }\r
 \r
       ASSERT (StringBuffer != NULL);\r
@@ -702,7 +704,7 @@ GetOptionalStringByIndex (
     *String = GetStringById (STRING_TOKEN (STR_MISSING_STRING));\r
   } else {\r
     *String = AllocatePool (StrSize * sizeof (CHAR16));\r
-    AsciiStrToUnicodeStr (OptionalStrStart, *String);\r
+    AsciiStrToUnicodeStrS (OptionalStrStart, *String, StrSize);\r
   }\r
 \r
   return EFI_SUCCESS;\r