summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Library/GenericBdsLib
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2015-06-30 06:25:54 +0000
committerhwu1225 <hwu1225@Edk2>2015-06-30 06:25:54 +0000
commited6d22e0f29b24ac39c6b442eab4bce1e0de2739 (patch)
tree5a8c82cdaaaff926bb70ea6e70a9bc8149675e20 /IntelFrameworkModulePkg/Library/GenericBdsLib
parent35e471dbb25e30d1628ab4f6ee450e062e5c733f (diff)
downloadedk2-ed6d22e0f29b24ac39c6b442eab4bce1e0de2739.zip
edk2-ed6d22e0f29b24ac39c6b442eab4bce1e0de2739.tar.gz
edk2-ed6d22e0f29b24ac39c6b442eab4bce1e0de2739.tar.bz2
IntelFrameworkModulePkg GenericBdsLib: Use safe string functions
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@17733 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Library/GenericBdsLib')
-rw-r--r--IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c14
-rw-r--r--IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c10
2 files changed, 14 insertions, 10 deletions
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c
index dbb1322..b5be631 100644
--- a/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c
+++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/BdsMisc.c
@@ -1,7 +1,7 @@
/** @file
Misc BDS library function
-Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -1127,12 +1127,16 @@ SetupResetReminder (
if (IsResetReminderFeatureEnable ()) {
if (IsResetRequired ()) {
- StringBuffer1 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16));
+ StringBuffer1 = AllocateCopyPool (
+ MAX_STRING_LEN * sizeof (CHAR16),
+ L"Configuration changed. Reset to apply it Now."
+ );
ASSERT (StringBuffer1 != NULL);
- StringBuffer2 = AllocateZeroPool (MAX_STRING_LEN * sizeof (CHAR16));
+ StringBuffer2 = AllocateCopyPool (
+ MAX_STRING_LEN * sizeof (CHAR16),
+ L"Press ENTER to reset"
+ );
ASSERT (StringBuffer2 != NULL);
- StrCpy (StringBuffer1, L"Configuration changed. Reset to apply it Now.");
- StrCpy (StringBuffer2, L"Press ENTER to reset");
//
// Popup a menu to notice user
//
diff --git a/IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c b/IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c
index 047d2a7..000542b 100644
--- a/IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c
+++ b/IntelFrameworkModulePkg/Library/GenericBdsLib/Performance.c
@@ -3,7 +3,7 @@
performance, all the function will only include if the performance
switch is set.
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -40,7 +40,7 @@ GetShortPdbFileName (
UINTN EndIndex;
if (PdbFileName == NULL) {
- AsciiStrCpy (GaugeString, " ");
+ AsciiStrCpyS (GaugeString, PERF_TOKEN_LENGTH, " ");
} else {
StartIndex = 0;
for (EndIndex = 0; PdbFileName[EndIndex] != 0; EndIndex++)
@@ -91,7 +91,7 @@ GetNameFromHandle (
CHAR8 *PdbFileName;
EFI_DRIVER_BINDING_PROTOCOL *DriverBinding;
- AsciiStrCpy (GaugeString, " ");
+ AsciiStrCpyS (GaugeString, PERF_TOKEN_LENGTH, " ");
//
// Get handle name from image protocol
@@ -287,7 +287,7 @@ WriteBootToOsPerformanceData (
GetNameFromHandle (Handles[Index], GaugeString);
- AsciiStrCpy (mPerfData.Token, GaugeString);
+ AsciiStrCpyS (mPerfData.Token, PERF_TOKEN_SIZE, GaugeString);
mPerfData.Duration = Duration;
CopyMem (Ptr, &mPerfData, sizeof (PERF_DATA));
@@ -316,7 +316,7 @@ WriteBootToOsPerformanceData (
ZeroMem (&mPerfData, sizeof (PERF_DATA));
- AsciiStrnCpy (mPerfData.Token, Token, PERF_TOKEN_LENGTH);
+ AsciiStrnCpyS (mPerfData.Token, PERF_TOKEN_SIZE, Token, PERF_TOKEN_LENGTH);
if (StartTicker == 1) {
StartTicker = StartValue;
}