]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelFrameworkPkg FrameworkUefiLib: Use safe string functions
authorHao Wu <hao.a.wu@intel.com>
Tue, 30 Jun 2015 06:28:57 +0000 (06:28 +0000)
committerhwu1225 <hwu1225@Edk2>
Tue, 30 Jun 2015 06:28:57 +0000 (06:28 +0000)
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

IntelFrameworkPkg/Library/FrameworkUefiLib/UefiLibPrint.c

index 63b077542f114413404865ef625c8432b987e17d..9a9503e03068f4c1f911286f1492ededfe80378a 100644 (file)
@@ -2,7 +2,7 @@
   Mde UEFI library API implementation.\r
   Print to StdErr or ConOut defined in EFI_SYSTEM_TABLE\r
 \r
-  Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2007 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -754,16 +754,12 @@ CatVSPrint (
     SizeRequired = sizeof(CHAR16) + (CharactersRequired * sizeof(CHAR16));\r
   }\r
 \r
-  BufferToReturn = AllocateZeroPool(SizeRequired);\r
+  BufferToReturn = AllocateCopyPool(SizeRequired, String);\r
 \r
   if (BufferToReturn == NULL) {\r
     return NULL;\r
   }\r
 \r
-  if (String != NULL) {\r
-    StrCpy(BufferToReturn, String);\r
-  }\r
-\r
   UnicodeVSPrint(BufferToReturn + StrLen(BufferToReturn), (CharactersRequired+1) * sizeof(CHAR16), FormatString, Marker);\r
 \r
   ASSERT(StrSize(BufferToReturn)==SizeRequired);\r