From: Zhang Lubo Date: Fri, 3 Jul 2015 07:27:31 +0000 (+0000) Subject: SecurityPkg: Calculate the length of the String. X-Git-Tag: edk2-stable201903~9454 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=cc976d20ffbab731ef6db7e3baa485de825d4b7e;ds=sidebyside 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 --- 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);