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.zh...@intel.com>
---
 .../UserIdentification/UserProfileManagerDxe/UserProfileModify.c        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileModify.c 
b/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileModify.c
index 67fc300..a0eb4af 100644
--- a/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileModify.c
+++ b/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileModify.c
@@ -336,11 +336,11 @@ AddStr (
 
   if (*Source1 == NULL) {
     StrLength = StrSize (Source2);
   } else {
     StrLength  = StrSize (*Source1);
-    StrLength += StrSize (Source2) -1;
+    StrLength += StrSize (Source2) - 2;
   }
 
   TmpStr     = AllocateZeroPool (StrLength);
   ASSERT (TmpStr != NULL);
 
-- 
1.9.5.msysgit.1



------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to