summaryrefslogtreecommitdiffstats
path: root/UnitTestFrameworkPkg
diff options
context:
space:
mode:
authorGuomin Jiang <guomin.jiang@intel.com>2020-03-31 10:57:01 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-04-26 01:25:14 +0000
commit63d425002a7d513759be6f216e5bacb9157a5ded (patch)
treebd412160dab25d34992886f0a1d237e85dc057ec /UnitTestFrameworkPkg
parentd5339c04d7cd47c061ec146a7b062052e3dc56ca (diff)
downloadedk2-63d425002a7d513759be6f216e5bacb9157a5ded.tar.gz
edk2-63d425002a7d513759be6f216e5bacb9157a5ded.tar.bz2
edk2-63d425002a7d513759be6f216e5bacb9157a5ded.zip
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>
Diffstat (limited to 'UnitTestFrameworkPkg')
-rw-r--r--UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c b/UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c
index ccca9bfacb..6da85c459d 100644
--- a/UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c
+++ b/UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c
@@ -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;
}