]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Universal/CapsuleRuntimeDxe: Use safe string functions to refine code.
authorQiu Shumin <shumin.qiu@intel.com>
Wed, 1 Jul 2015 08:23:30 +0000 (08:23 +0000)
committershenshushi <shenshushi@Edk2>
Wed, 1 Jul 2015 08:23:30 +0000 (08:23 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17784 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleService.c

index 61ee91951ba79f4833316d0d3f8652a679d3d567..ed8820a8f714195187d469a09c3b9378000741f0 100644 (file)
@@ -4,7 +4,7 @@
   It installs the Capsule Architectural Protocol defined in PI1.0a to signify \r
   the capsule runtime services are ready.\r
 \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 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
@@ -202,7 +202,7 @@ UpdateCapsule (
   // Construct variable name CapsuleUpdateData, CapsuleUpdateData1, CapsuleUpdateData2...\r
   // if user calls UpdateCapsule multiple times.\r
   //\r
-  StrCpy (CapsuleVarName, EFI_CAPSULE_VARIABLE_NAME);\r
+  StrCpyS (CapsuleVarName, sizeof(CapsuleVarName)/sizeof(CHAR16), EFI_CAPSULE_VARIABLE_NAME);\r
   TempVarName = CapsuleVarName + StrLen (CapsuleVarName);\r
   if (mTimes > 0) {\r
     UnicodeValueToString (TempVarName, 0, mTimes, 0);\r