]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UnitTestFrameworkPkg/PersistenceLib: Correct the allocated size.
authorGuomin Jiang <guomin.jiang@intel.com>
Tue, 31 Mar 2020 02:57:01 +0000 (10:57 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sun, 26 Apr 2020 01:25:14 +0000 (01:25 +0000)
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>
UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem/UnitTestPersistenceLibSimpleFileSystem.c

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