summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiDpLib/DpUtilities.c
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Library/UefiDpLib/DpUtilities.c')
-rw-r--r--ShellPkg/Library/UefiDpLib/DpUtilities.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ShellPkg/Library/UefiDpLib/DpUtilities.c b/ShellPkg/Library/UefiDpLib/DpUtilities.c
index 7290285e23..063eb658c8 100644
--- a/ShellPkg/Library/UefiDpLib/DpUtilities.c
+++ b/ShellPkg/Library/UefiDpLib/DpUtilities.c
@@ -261,7 +261,7 @@ GetNameFromHandle (
);
if (!EFI_ERROR (Status)) {
SHELL_FREE_NON_NULL (PlatformLanguage);
- StrCpyS (mGaugeString, DP_GAUGE_STRING_LENGTH + 1, StringPtr);
+ StrnCpyS (mGaugeString, DP_GAUGE_STRING_LENGTH + 1, StringPtr, DP_GAUGE_STRING_LENGTH);
mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;
return;
}
@@ -305,7 +305,7 @@ GetNameFromHandle (
//
// Method 3. Get the name string from FFS UI section
//
- StrCpyS (mGaugeString, DP_GAUGE_STRING_LENGTH + 1, NameString);
+ StrnCpyS (mGaugeString, DP_GAUGE_STRING_LENGTH + 1, NameString, DP_GAUGE_STRING_LENGTH);
mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;
FreePool (NameString);
} else {
@@ -321,7 +321,7 @@ GetNameFromHandle (
//
NameString = ConvertDevicePathToText (LoadedImageDevicePath, TRUE, FALSE);
if (NameString != NULL) {
- StrCpyS (mGaugeString, DP_GAUGE_STRING_LENGTH + 1, NameString);
+ StrnCpyS (mGaugeString, DP_GAUGE_STRING_LENGTH + 1, NameString, DP_GAUGE_STRING_LENGTH);
mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;
FreePool (NameString);
return;
@@ -334,7 +334,7 @@ GetNameFromHandle (
//
StringPtr = HiiGetString (gDpHiiHandle, STRING_TOKEN (STR_DP_ERROR_NAME), NULL);
ASSERT (StringPtr != NULL);
- StrCpyS (mGaugeString, DP_GAUGE_STRING_LENGTH + 1, StringPtr);
+ StrnCpyS (mGaugeString, DP_GAUGE_STRING_LENGTH + 1, StringPtr, DP_GAUGE_STRING_LENGTH);
FreePool (StringPtr);
}