Reviewed-by: Ray Ni <[email protected]>

> -----Original Message-----
> From: Shindo, Miki <[email protected]>
> Sent: Wednesday, July 20, 2022 4:28 AM
> To: [email protected]
> Cc: Andrew Fish <[email protected]>; Ni, Ray <[email protected]>
> Subject: [PATCH] EmulatorPkg/PosixFileSystem: Add NULL check on memory
> allocation
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4001
> 
> This commit adds NULL check on memory allocation of the size
> for FileName in ASCII string format at PosixFileSetInfo().
> 
> Signed-off-by: Miki Shindo <[email protected]>
> Cc: Andrew Fish <[email protected]>
> Cc: Ray Ni <[email protected]>
> ---
>  EmulatorPkg/Unix/Host/PosixFileSystem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/EmulatorPkg/Unix/Host/PosixFileSystem.c
> b/EmulatorPkg/Unix/Host/PosixFileSystem.c
> index ae3fe72a05..b69d3d5520 100644
> --- a/EmulatorPkg/Unix/Host/PosixFileSystem.c
> +++ b/EmulatorPkg/Unix/Host/PosixFileSystem.c
> @@ -1187,7 +1187,7 @@ PosixFileSetInfo (
>    }
> 
> 
> 
>    OldFileName = malloc (AsciiStrSize (PrivateFile->FileName));
> 
> -  if (OldFileInfo == NULL) {
> 
> +  if (OldFileName == NULL) {
> 
>      goto Done;
> 
>    }
> 
> 
> 
> --
> 2.27.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91575): https://edk2.groups.io/g/devel/message/91575
Mute This Topic: https://groups.io/mt/92491604/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to