UnitTestFrameworkPkg/PersistenceLib: Correct the allocated size.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2608

According to logic and the practice, it is need to allocate ascii length
by 2 for unicode string.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Reviewed-by: Sean Brogan <sean.brogan@microsoft.com>
This commit is contained in:
Guomin Jiang 2020-03-31 10:57:01 +08:00 committed by mergify[bot]
parent d5339c04d7
commit 63d425002a
1 changed files with 1 additions and 1 deletions

View File

@ -67,7 +67,7 @@ GetCacheFileDevicePath (
// Before we can start, change test name from ASCII to Unicode.
//
CacheFilePathLength = AsciiStrLen (Framework->ShortTitle) + 1;
TestName = AllocatePool (CacheFilePathLength);
TestName = AllocatePool (CacheFilePathLength * sizeof(CHAR16));
if (!TestName) {
goto Exit;
}