public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] EmulatorPkg/PosixFileSystem: Add NULL check on memory allocation
@ 2022-07-19 20:28 Miki Shindo
  2022-07-20 10:13 ` Ni, Ray
  0 siblings, 1 reply; 2+ messages in thread
From: Miki Shindo @ 2022-07-19 20:28 UTC (permalink / raw)
  To: devel; +Cc: Andrew Fish, Ray Ni

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.shindo@intel.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Ray Ni <ray.ni@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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] EmulatorPkg/PosixFileSystem: Add NULL check on memory allocation
  2022-07-19 20:28 [PATCH] EmulatorPkg/PosixFileSystem: Add NULL check on memory allocation Miki Shindo
@ 2022-07-20 10:13 ` Ni, Ray
  0 siblings, 0 replies; 2+ messages in thread
From: Ni, Ray @ 2022-07-20 10:13 UTC (permalink / raw)
  To: Shindo, Miki, devel@edk2.groups.io; +Cc: Andrew Fish

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

> -----Original Message-----
> From: Shindo, Miki <miki.shindo@intel.com>
> Sent: Wednesday, July 20, 2022 4:28 AM
> To: devel@edk2.groups.io
> Cc: Andrew Fish <afish@apple.com>; Ni, Ray <ray.ni@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.shindo@intel.com>
> Cc: Andrew Fish <afish@apple.com>
> Cc: Ray Ni <ray.ni@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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-20 10:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-19 20:28 [PATCH] EmulatorPkg/PosixFileSystem: Add NULL check on memory allocation Miki Shindo
2022-07-20 10:13 ` Ni, Ray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox