diff options
author | Dandan Bi <dandan.bi@intel.com> | 2015-08-13 00:15:06 +0000 |
---|---|---|
committer | dandanbi <dandanbi@Edk2> | 2015-08-13 00:15:06 +0000 |
commit | d91cb87049db11a193bacec72506a24df19e46e9 (patch) | |
tree | d9cfb294e8788cb0e2a8763a73bb82a08e3af7a4 /MdeModulePkg/Application/UiApp/BootMngr/BootManager.c | |
parent | 0cd1ecea673160417e30e46009a54d361a131235 (diff) | |
download | edk2-platforms-d91cb87049db11a193bacec72506a24df19e46e9.tar.xz |
MdeModulePkg:Use safe string functions in UiApp.
Replace the unsafe string functions with the safe one in UiApp.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18214 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Application/UiApp/BootMngr/BootManager.c')
-rw-r--r-- | MdeModulePkg/Application/UiApp/BootMngr/BootManager.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c b/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c index fa35ad4bf2..986413c19b 100644 --- a/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c +++ b/MdeModulePkg/Application/UiApp/BootMngr/BootManager.c @@ -236,6 +236,7 @@ EnumerateBootOptions ( BOOLEAN IsLegacyOption;
BOOLEAN NeedEndOp;
UINT16 KeyInput;
+ UINTN DestMax;
DeviceType = (UINT16) -1;
@@ -325,10 +326,11 @@ EnumerateBootOptions ( TempStr = UiDevicePathToStr (BootOption[Index].FilePath);
TempSize = StrSize (TempStr);
+ DestMax = (TempSize + StrSize (L"Device Path : ")) / sizeof(CHAR16);
HelpString = AllocateZeroPool (TempSize + StrSize (L"Device Path : "));
ASSERT (HelpString != NULL);
- StrCat (HelpString, L"Device Path : ");
- StrCat (HelpString, TempStr);
+ StrCatS (HelpString, DestMax, L"Device Path : ");
+ StrCatS (HelpString, DestMax, TempStr);
HelpToken = HiiSetString (HiiHandle, 0, HelpString, NULL);
|