[edk2-devel] [PATCH] UnitTestFrameworkPkg/PersistenceLib: Correct the allocated size.

Guomin Jiang guomin.jiang at intel.com
Wed Apr 8 05:27:24 UTC 2020


Hi Kinney, Sean, Bret,

Could you help review the change?

Best Regards
Guomin

> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Guomin
> Jiang
> Sent: Tuesday, March 31, 2020 11:06 AM
> To: devel at edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney at intel.com>; Sean Brogan
> <sean.brogan at microsoft.com>; Bret Barkelew
> <Bret.Barkelew at 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.kinney at intel.com>
> Cc: Sean Brogan <sean.brogan at microsoft.com>
> Cc: Bret Barkelew <Bret.Barkelew at microsoft.com>
> Signed-off-by: Guomin Jiang <guomin.jiang at 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+owner at edk2.groups.io
> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> [guomin.jiang at 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/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list