MdeModulePkg:Use safe string functions

Replace unsafe String functions with new added safe string functions

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17724 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Dandan Bi
2015-06-29 02:36:31 +00:00
committed by dandanbi
parent e9da7deaa4
commit 5ad66ec692
13 changed files with 201 additions and 155 deletions

View File

@@ -1324,6 +1324,7 @@ IfrCatenate (
UINT16 Length0;
UINT16 Length1;
UINT8 *TmpBuf;
UINTN MaxLen;
//
// String[0] - The second string
@@ -1363,10 +1364,11 @@ IfrCatenate (
if (Value[0].Type == EFI_IFR_TYPE_STRING) {
Size = StrSize (String[0]);
StringPtr= AllocatePool (StrSize (String[1]) + Size);
MaxLen = (StrSize (String[1]) + Size) / sizeof (CHAR16);
StringPtr= AllocatePool (MaxLen * sizeof (CHAR16));
ASSERT (StringPtr != NULL);
StrCpy (StringPtr, String[1]);
StrCat (StringPtr, String[0]);
StrCpyS (StringPtr, MaxLen, String[1]);
StrCatS (StringPtr, MaxLen, String[0]);
Result->Type = EFI_IFR_TYPE_STRING;
Result->Value.string = NewString (StringPtr, FormSet->HiiHandle);