Reviewed-by: Ray Ni <ray...@intel.com>

> -----Original Message-----
> From: Shindo, Miki <miki.shi...@intel.com>
> Sent: Wednesday, July 20, 2022 4:28 AM
> To: devel@edk2.groups.io
> Cc: Andrew Fish <af...@apple.com>; Ni, Ray <ray...@intel.com>
> 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 <miki.shi...@intel.com>
> Cc: Andrew Fish <af...@apple.com>
> Cc: Ray Ni <ray...@intel.com>
> ---
>  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: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to