mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 07:34:06 +02:00
IntelFrameworkPkg FrameworkUefiLib: Use safe string functions
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17740 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
c5ad1f8621
commit
01a5dd0b26
@ -2,7 +2,7 @@
|
|||||||
Mde UEFI library API implementation.
|
Mde UEFI library API implementation.
|
||||||
Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE
|
Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE
|
||||||
|
|
||||||
Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
@ -754,16 +754,12 @@ CatVSPrint (
|
|||||||
SizeRequired = sizeof(CHAR16) + (CharactersRequired * sizeof(CHAR16));
|
SizeRequired = sizeof(CHAR16) + (CharactersRequired * sizeof(CHAR16));
|
||||||
}
|
}
|
||||||
|
|
||||||
BufferToReturn = AllocateZeroPool(SizeRequired);
|
BufferToReturn = AllocateCopyPool(SizeRequired, String);
|
||||||
|
|
||||||
if (BufferToReturn == NULL) {
|
if (BufferToReturn == NULL) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (String != NULL) {
|
|
||||||
StrCpy(BufferToReturn, String);
|
|
||||||
}
|
|
||||||
|
|
||||||
UnicodeVSPrint(BufferToReturn + StrLen(BufferToReturn), (CharactersRequired+1) * sizeof(CHAR16), FormatString, Marker);
|
UnicodeVSPrint(BufferToReturn + StrLen(BufferToReturn), (CharactersRequired+1) * sizeof(CHAR16), FormatString, Marker);
|
||||||
|
|
||||||
ASSERT(StrSize(BufferToReturn)==SizeRequired);
|
ASSERT(StrSize(BufferToReturn)==SizeRequired);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user