From 01a5dd0b260ee7861dcdb0ed092830441e475f88 Mon Sep 17 00:00:00 2001 From: Hao Wu Date: Tue, 30 Jun 2015 06:28:57 +0000 Subject: IntelFrameworkPkg FrameworkUefiLib: Use safe string functions Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu Reviewed-by: Liming Gao Reviewed-by: Jaben Carsey git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17740 6f19259b-4bc3-4df7-8a09-765794883524 --- IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLibPrint.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'IntelFrameworkPkg/Library') diff --git a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLibPrint.c b/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLibPrint.c index 63b0775..9a9503e 100644 --- a/IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLibPrint.c +++ b/IntelFrameworkPkg/Library/FrameworkUefiLib/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.
+ Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.
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); -- cgit v1.1