diff options
author | Guomin Jiang <guomin.jiang@intel.com> | 2020-03-31 10:57:01 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-04-26 01:25:14 +0000 |
commit | 63d425002a7d513759be6f216e5bacb9157a5ded (patch) | |
tree | bd412160dab25d34992886f0a1d237e85dc057ec /UnitTestFrameworkPkg | |
parent | d5339c04d7cd47c061ec146a7b062052e3dc56ca (diff) | |
download | edk2-63d425002a7d513759be6f216e5bacb9157a5ded.zip edk2-63d425002a7d513759be6f216e5bacb9157a5ded.tar.gz edk2-63d425002a7d513759be6f216e5bacb9157a5ded.tar.bz2 |
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c b/UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c index ccca9bf..6da85c4 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;
}
|