/** @file\r
BDS Lib functions which relate with create or process the boot option.\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
//\r
// Create new BBS device path node with description string\r
//\r
- UnicodeStrToAsciiStr (BootDesc, HelpString);\r
+ UnicodeStrToAsciiStrS (BootDesc, HelpString, sizeof (HelpString));\r
\r
StringLen = AsciiStrLen (HelpString);\r
NewBbsDevPathNode = AllocateZeroPool (sizeof (BBS_BBS_DEVICE_PATH) + StringLen);\r
and manage the legacy boot option, all legacy boot option is getting from\r
the legacy BBS table.\r
\r
-Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2011 - 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
//\r
CopyMem (StringBufferA, StringDesc, LEGACY_BM_BOOT_DESCRIPTION_LENGTH);\r
StringBufferA[LEGACY_BM_BOOT_DESCRIPTION_LENGTH] = 0;\r
- AsciiStrToUnicodeStr (StringBufferA, StringBufferU);\r
+ AsciiStrToUnicodeStrS (StringBufferA, StringBufferU, sizeof (StringBufferU) / sizeof (StringBufferU[0]));\r
Fmt = L"%s";\r
Type = StringBufferU;\r
}\r
//\r
// Create the BBS device path with description string\r
//\r
- UnicodeStrToAsciiStr (Description, HelpString);\r
+ UnicodeStrToAsciiStrS (Description, HelpString, sizeof (HelpString));\r
StringLen = AsciiStrLen (HelpString);\r
DevicePath = AllocatePool (sizeof (BBS_BBS_DEVICE_PATH) + StringLen + END_DEVICE_PATH_LENGTH);\r
ASSERT (DevicePath != NULL);\r
/** @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
EFI_STATUS Status;\r
CHAR8 *LangCode;\r
CHAR8 *Lang;\r
+ UINTN LangSize;\r
CHAR8 *CurrentLang;\r
UINTN OptionCount;\r
CHAR16 *StringBuffer;\r
}\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
*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