public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] UnitTestFrameworkPkg/PersistenceLib: Correct the allocated size.
@ 2020-03-31  3:05 Guomin Jiang
  0 siblings, 0 replies; only message in thread
From: Guomin Jiang @ 2020-03-31  3:05 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Sean Brogan, Bret Barkelew

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>
---
 .../UnitTestPersistenceLibSimpleFileSystem.c                    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
   }
-- 
2.25.1.windows.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-03-31  3:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-31  3:05 [PATCH] UnitTestFrameworkPkg/PersistenceLib: Correct the allocated size Guomin Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox