summaryrefslogtreecommitdiff
path: root/MdePkg/Library/UefiLib/UefiLibPrint.c
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2015-06-30 06:29:51 +0000
committerhwu1225 <hwu1225@Edk2>2015-06-30 06:29:51 +0000
commitdf1e74f5a267fb6eb303b90bea7bdc766a9d4af9 (patch)
tree254f3fe2081d72fdedcd04309ac939fe21d93f9c /MdePkg/Library/UefiLib/UefiLibPrint.c
parent750b4513b30066a0e42e2d3ba8e383c5709b03f0 (diff)
downloadedk2-platforms-df1e74f5a267fb6eb303b90bea7bdc766a9d4af9.tar.xz
MdePkg UefiLib: 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@17742 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/UefiLib/UefiLibPrint.c')
-rw-r--r--MdePkg/Library/UefiLib/UefiLibPrint.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/MdePkg/Library/UefiLib/UefiLibPrint.c b/MdePkg/Library/UefiLib/UefiLibPrint.c
index 1bf6d26821..cc41eb0343 100644
--- a/MdePkg/Library/UefiLib/UefiLibPrint.c
+++ b/MdePkg/Library/UefiLib/UefiLibPrint.c
@@ -2,7 +2,7 @@
Mde UEFI library API implementation.
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
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
@@ -754,16 +754,12 @@ CatVSPrint (
SizeRequired = sizeof(CHAR16) + (CharactersRequired * sizeof(CHAR16));
}
- BufferToReturn = AllocateZeroPool(SizeRequired);
+ BufferToReturn = AllocateCopyPool(SizeRequired, String);
if (BufferToReturn == NULL) {
return NULL;
}
- if (String != NULL) {
- StrCpy(BufferToReturn, String);
- }
-
UnicodeVSPrint(BufferToReturn + StrLen(BufferToReturn), (CharactersRequired+1) * sizeof(CHAR16), FormatString, Marker);
ASSERT(StrSize(BufferToReturn)==SizeRequired);