]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg: Calculate the length of the String.
authorZhang Lubo <lubo.zhang@intel.com>
Fri, 3 Jul 2015 07:27:31 +0000 (07:27 +0000)
committerluobozhang <luobozhang@Edk2>
Fri, 3 Jul 2015 07:27:31 +0000 (07:27 +0000)
When the two concatenated strings are both not null, the total length in bytes of them should calculate the character '\0' once.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-by: jiaxinwu <jiaxin.wu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17820 6f19259b-4bc3-4df7-8a09-765794883524

SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileModify.c

index 67fc300f7257724e3273ad57e4f7d2ddfbd7aad1..a0eb4afa9edbed4677602d79cc8c53facb03e655 100644 (file)
@@ -338,7 +338,7 @@ AddStr (
     StrLength = StrSize (Source2);\r
   } else {\r
     StrLength  = StrSize (*Source1);\r
-    StrLength += StrSize (Source2) -1;\r
+    StrLength += StrSize (Source2) - 2;\r
   }\r
 \r
   TmpStr     = AllocateZeroPool (StrLength);\r