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 <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
This commit is contained in:
Zhang Lubo 2015-07-03 07:27:31 +00:00 committed by luobozhang
parent 0bb5d7a55b
commit cc976d20ff
1 changed files with 1 additions and 1 deletions

View File

@ -338,7 +338,7 @@ AddStr (
StrLength = StrSize (Source2); StrLength = StrSize (Source2);
} else { } else {
StrLength = StrSize (*Source1); StrLength = StrSize (*Source1);
StrLength += StrSize (Source2) -1; StrLength += StrSize (Source2) - 2;
} }
TmpStr = AllocateZeroPool (StrLength); TmpStr = AllocateZeroPool (StrLength);