Zhang Lubo
2015-06-30 05:26:55 UTC
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 <***@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);
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <***@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
1.9.5.msysgit.1