From 63d425002a7d513759be6f216e5bacb9157a5ded Mon Sep 17 00:00:00 2001 From: Guomin Jiang Date: Tue, 31 Mar 2020 10:57:01 +0800 Subject: 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 Cc: Sean Brogan Cc: Bret Barkelew Signed-off-by: Guomin Jiang Reviewed-by: Sean Brogan --- .../UnitTestPersistenceLibSimpleFileSystem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'UnitTestFrameworkPkg') 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; } -- cgit v1.2.3