]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Universal/CapsulePei: Use safe string functions to refine code.
authorQiu Shumin <shumin.qiu@intel.com>
Wed, 1 Jul 2015 08:22:31 +0000 (08:22 +0000)
committershenshushi <shenshushi@Edk2>
Wed, 1 Jul 2015 08:22:31 +0000 (08:22 +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@17783 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/CapsulePei/UefiCapsule.c

index 6b934c9e3c91408b39b41d50eb8fecef2a6effd0..3184eb1a6249fa7be8f3f07080c1fb5f9913365e 100644 (file)
@@ -583,7 +583,7 @@ GetCapsuleDescriptors (
               (VOID **) &PPIVariableServices\r
               );\r
   if (Status == EFI_SUCCESS) {\r
-    StrCpy (CapsuleVarName, EFI_CAPSULE_VARIABLE_NAME);\r
+    StrCpyS (CapsuleVarName, sizeof(CapsuleVarName)/sizeof(CHAR16), EFI_CAPSULE_VARIABLE_NAME);\r
     TempVarName = CapsuleVarName + StrLen (CapsuleVarName);\r
     Size = sizeof (CapsuleDataPtr64);\r
     while (1) {\r
@@ -773,7 +773,7 @@ CapsuleCoalesce (
     goto Done;\r
   }\r
   Size = sizeof (CapsuleDataPtr64);\r
-  StrCpy (CapsuleVarName, EFI_CAPSULE_VARIABLE_NAME);\r
+  StrCpyS (CapsuleVarName, sizeof(CapsuleVarName)/sizeof(CHAR16), EFI_CAPSULE_VARIABLE_NAME);\r
   TempVarName = CapsuleVarName + StrLen (CapsuleVarName);\r
   while (TRUE) {\r
     if (Index > 0) {\r