Qiu Shumin
2015-06-25 07:46:41 UTC
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <***@intel.com>
---
MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c
index 6304b7f..4b5f4f2 100644
--- a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c
+++ b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c
@@ -124,7 +124,7 @@ GetShortPdbFileName (
ZeroMem (UnicodeBuffer, PROFILE_NAME_STRING_LENGTH * sizeof (CHAR16));
if (PdbFileName == NULL) {
- StrnCpy (UnicodeBuffer, L" ", 1);
+ StrnCpyS (UnicodeBuffer, PROFILE_NAME_STRING_LENGTH, L" ", 1);
} else {
StartIndex = 0;
for (EndIndex = 0; PdbFileName[EndIndex] != 0; EndIndex++);
@@ -201,7 +201,7 @@ GetDriverNameString (
//
// Method 2: Get the name string from FFS UI section
//
- StrnCpy (mNameString, NameString, PROFILE_NAME_STRING_LENGTH);
+ StrCpyS (mNameString, PROFILE_NAME_STRING_LENGTH + 1, NameString);
mNameString[PROFILE_NAME_STRING_LENGTH] = 0;
FreePool (NameString);
return;
Signed-off-by: Qiu Shumin <***@intel.com>
---
MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c
index 6304b7f..4b5f4f2 100644
--- a/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c
+++ b/MdeModulePkg/Application/MemoryProfileInfo/MemoryProfileInfo.c
@@ -124,7 +124,7 @@ GetShortPdbFileName (
ZeroMem (UnicodeBuffer, PROFILE_NAME_STRING_LENGTH * sizeof (CHAR16));
if (PdbFileName == NULL) {
- StrnCpy (UnicodeBuffer, L" ", 1);
+ StrnCpyS (UnicodeBuffer, PROFILE_NAME_STRING_LENGTH, L" ", 1);
} else {
StartIndex = 0;
for (EndIndex = 0; PdbFileName[EndIndex] != 0; EndIndex++);
@@ -201,7 +201,7 @@ GetDriverNameString (
//
// Method 2: Get the name string from FFS UI section
//
- StrnCpy (mNameString, NameString, PROFILE_NAME_STRING_LENGTH);
+ StrCpyS (mNameString, PROFILE_NAME_STRING_LENGTH + 1, NameString);
mNameString[PROFILE_NAME_STRING_LENGTH] = 0;
FreePool (NameString);
return;
--
1.9.5.msysgit.1
1.9.5.msysgit.1