Hi Kinney, Sean, Bret, Could you help review the change?
Best Regards Guomin > -----Original Message----- > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Guomin > Jiang > Sent: Tuesday, March 31, 2020 11:06 AM > To: devel@edk2.groups.io > Cc: Kinney, Michael D <michael.d.kin...@intel.com>; Sean Brogan > <sean.bro...@microsoft.com>; Bret Barkelew > <bret.barke...@microsoft.com> > Subject: [edk2-devel] [PATCH] 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.kin...@intel.com> > Cc: Sean Brogan <sean.bro...@microsoft.com> > Cc: Bret Barkelew <bret.barke...@microsoft.com> > Signed-off-by: Guomin Jiang <guomin.ji...@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 > > > -=-=-=-=-=-= > Groups.io Links: You receive all messages sent to this group. > > View/Reply Online (#56714): https://edk2.groups.io/g/devel/message/56714 > Mute This Topic: https://groups.io/mt/72670002/4399222 > Group Owner: devel+ow...@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub > [guomin.ji...@intel.com] > -=-=-=-=-=-= -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#57049): https://edk2.groups.io/g/devel/message/57049 Mute This Topic: https://groups.io/mt/72670002/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-