From cc976d20ffbab731ef6db7e3baa485de825d4b7e Mon Sep 17 00:00:00 2001 From: Zhang Lubo Date: Fri, 3 Jul 2015 07:27:31 +0000 Subject: [PATCH] SecurityPkg: Calculate the length of the String. 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 Reviewed-by: jiaxinwu git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17820 6f19259b-4bc3-4df7-8a09-765794883524 --- .../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 67fc300f72..a0eb4afa9e 100644 --- a/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileModify.c +++ b/SecurityPkg/UserIdentification/UserProfileManagerDxe/UserProfileModify.c @@ -338,7 +338,7 @@ AddStr ( StrLength = StrSize (Source2); } else { StrLength = StrSize (*Source1); - StrLength += StrSize (Source2) -1; + StrLength += StrSize (Source2) - 2; } TmpStr = AllocateZeroPool (StrLength);